-
Notifications
You must be signed in to change notification settings - Fork 384
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
Auth: Update email account will not update the adress to log in #67
Comments
Thanks for the bug report @Etheonor. I'm going to move this over to the GoTrue repo so we can discuss the expected behaviour. Possibly related, since this PR occured after our fork was created: netlify/gotrue#243 |
OK I did some testing here and can confirm: supabase/auth-js#57 We need to decide whether to handle this in the client or the server. We could handle it in the client like this: supabase/auth-js#58. I'm not sure why Netlify chose this strategy to start with |
Another thing, when we update this new_email element, if you do a supabase.auth.user() right after, you will not have the updated user. You have to logout/login to have the new_mail properly updated. This is far from ideal Edit: after further investigation If you do a auth.refreshSession() and log the result, you'll have the updated user/session. But it seems that the info is not transfered to the context. |
@kiwicopple @awalias I've looked though code that implements user change. That code is responsible for email change too, but I am not sure that it has been worked ever. Logic that handles email change placed in handler that requires auth token and has PUT method, not GET. Plus, default variable MAILER_URLPATHS_EMAIL_CHANGE is / and GOTRUE doesn't have handler for that url at all=) |
related: #60 |
Hey @Etheonor, i think this issue has been resolved already. You can update your email with |
I'm having this exact same issue. I call |
If you update the email adress with supabase.auth.update, it will not replace the old one but create a "new_email" element in your auth.user object.
Therefore, when you try to log in again with the new updated email, it will not work and you'll have to use the old one.
The text was updated successfully, but these errors were encountered: