Closed AndyW22 closed 3 years ago
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()
without any passed parameter will use the cache to get the information about the authenticated user. This is why you will still see the property email_verified: false
when calling the function with defaults (even after verifying the email). To bypass the cache and get the latest user data you can pass options as follows:
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!
Hi 👋 Closing this as we have not heard back from you. If you are still experiencing this issue and in need of assistance, please feel free to comment and provide us with any information previously requested by our team members so we can re-open this issue and be better able to assist you. Thank you!
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()
without any passed parameter will use the cache to get the information about the authenticated user. This is why you will still see the propertyemail_verified: false
when calling the function with defaults (even after verifying the email). To bypass the cache and get the latest user data you can pass options as follows: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!
Can confirm that adding bypassCache to Auth.currentAuthenticatedUser fixed the issue, thanks!
This issue has been automatically locked since there hasn't been any recent activity after it was closed. Please open a new issue for related bugs.
Looking for a help forum? We recommend joining the Amplify Community Discord server *-help
channels or Discussions for those types of questions.
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: false
despite 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
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: