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

When a logged-in user calls confirmEmailAndSignIn(), the user ID does not update #310

Open
cpatracker opened this issue Oct 15, 2024 · 0 comments

Comments

@cpatracker
Copy link

When we try to retrieve user information after calling $auth->confirmEmailAndSignIn() using $auth->getUserId(), it returns the user ID of the previously logged-in user instead of the newly registered one.

The flow is as follows:

  1. User 1 is logged in
  2. User 1 tries to register a new account for a friend (User 2) by opening the registration form, entering the required information, and requesting a confirmation link
  3. User 1 opens the confirmation link for User 2
  4. confirmEmailAndSignIn() is called; User 2’s email is confirmed, and their account is created
  5. When we attempt to log information about the new user (User 2) to the logs or database, getUserId() still returns the ID of User 1

Possible workaround
$auth->logOut() can be called during the confirmation link process, but this will log out the user even if they click on an invalid confirmation link

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

No branches or pull requests

1 participant