Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Admin\Profile - IDIR auth session not passing info to Profile #1969

Closed
andrea-williams opened this issue Jul 19, 2024 · 3 comments
Closed

Admin\Profile - IDIR auth session not passing info to Profile #1969

andrea-williams opened this issue Jul 19, 2024 · 3 comments
Assignees
Labels

Comments

@andrea-williams
Copy link
Collaborator

andrea-williams commented Jul 19, 2024

Describe the Bug:

In develop branch of Administration, once I log in with my idir I'm auto-redirected to the Profile page (as expected). However, in theory we have logic in place to pull my first and last name, and email address from my session.user info and prepopulate the form with it - this isn't happening.

Steps to reproduce the behaviour:

  1. Be Andrea
  2. Log in to local env using IDIR
  3. get redirected to Profile page to create a new user for myself
  4. all fields in the form are empty, where I would expect first_name, last_name, and email_address to be pre-populated from my auth session info
  5. Network tab in browser shows a successful call to /session with my info (yes I am doxxing myself with this screenshot)

Image

  1. in bciers/apps/administration/app/components/profile/ProfilePage.tsx,
    getUserFormData is returning an error, so we enter the if ("error" in formData) logic, and console.log shows that the session fetched from await auth() is null, so session.user is undefined, which is why the formData in the UI is empty
  2. ProfilePage does not allow the user to enter their own email address, since we intentionally force the user to use the email address associated with their IDIR/BCeID account. This means that I'm stuck on the profile page because I can't set my email address and it's a mandatory field.

Additional information:

My frontend server logs repeatedly shows

[auth][error] JWTSessionError: Read more at https://errors.authjs.dev#jwtsessionerror
[auth][cause]: Error: no matching decryption secret

which might be related to this open issue in nextauth

@shon-button shon-button self-assigned this Jul 30, 2024
@shon-button
Copy link
Contributor

shon-button commented Jul 30, 2024

@andrea-williams

I cannot, at this point, reproduce your error.
I have read the open issue, and
I have tried removing my NEXTAUTH_SECRET .env variable and tried duplicating the same .env variable without causing your unexpected issue...

As an attempt of the desperate...

  1. have you tried deleting bciers/node_modules and running cd bciers && yarn
  2. Do you have NEXTAUTH_SECRET and AUTH_SECRET defined

@andrea-williams
Copy link
Collaborator Author

I have deleted all the .env and .env.local files that I believe were unnecessary, and also blew away my node_modules dirs in /client and /bciers.

Tadaaaaaaa it works now! Thanks @shon-button 😸

@andrea-williams
Copy link
Collaborator Author

The solution: don't be Andrea.

Closing this issue now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants