Verifying a new email causes Auth.currentAuthenticatedUser / .signIn to always return unverified email. #8169
Comments
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
|
This issue has been automatically closed because of inactivity. Please open a new issue if are still encountering problems. |
|
Hello @AndyW22! Does this issue persist after signing out then signing back in? or are you getting locked out because the email is not verified? I just tested this and it looks like everything is working fine. Can you please provide a little more details on this? Keep in mind that Auth.currentAuthenticatedUser({
bypassCache: true
});Let me know if that helps with the issue. Otherwise, please provide a little more details on how you are getting the problem and I will be happy to help! |
Before opening, please confirm:
JavaScript Framework
React
Amplify APIs
Authentication
Amplify Categories
auth
Environment information
Describe the bug
Updating users email will cause Auth.currentAuthenticatedUser() or Auth.signIn to always return
verified_email: falsedespite cognito saying they are confirmed + verified.This is very problematic as it causes a user to be permanantly locked out, if the user tries to verify their email it returns "user is already confirmed", but they can't sign in to my app because it requires a verified email. Theres no way for the user to now verify their email (since it should already be verified) and the user has to re sign up for it to work again.
Expected behavior
Once updating the users email, Auth.currentAuthenticatedUser() and Auth.signIn should be returning correct data from cognito, that the email is verified.
Reproduction steps
const data = await Auth.currentAuthenticatedUser(); await Auth.updateUserAttributes(data, { "email": email, });Once a code is emailed:
const result = await Auth.verifyCurrentUserAttributeSubmit("email", code);result returns "SUCCESS" and the new email is confirmed and verified on the cognito console.
const data = await Auth.currentAuthenticatedUser();will now return the user with the correct email but it will say its unverified and it can't be changed.Code Snippet
// Put your code below this line.Log output
aws-exports.js
No response
Manual configuration
Additional configuration
No response
Mobile Device
No response
Mobile Operating System
No response
Mobile Browser
No response
Mobile Browser Version
No response
Additional information and screenshots
My auth settings:
The text was updated successfully, but these errors were encountered: