Auth.verifyCurrentUserAttribute - Error: No current user
See original GitHub issueDescribe the bug The process to verifying the attribute like ‘email’, via Auth.verifyCurrentUserAttribute(attr), is not finding the user and sending the ‘the_verification_code’ to email.
I already have successfully implemented every other Authentication feature needed in the app.
Code To Reproduce Redux Action that connects w/ AWS:
export function checkAttribute(email) {
return dispatch => {
dispatch(confirmUserLoading(true));
console.log('UserEmail:', email);
Auth.verifyCurrentUserAttribute(email)
.then(() => {
dispatch(confirmUserCodeSentSucessfully());
console.log('verification code - UserEmail:', email);
console.log('a verification code is sent');
})
.catch(err => {
dispatch(confirmUserError());
dispatch(confirmUserErrorMsg(err));
console.log('error - UserEmail:', email);
console.log('confirmUser with error', err);
});
dispatch(confirmUserLoading(false));
};
}
Expected behavior find user and send the_verification_code to email to continue process
Screenshots
dependencies :
"dependencies": {
"aws-amplify": "^1.1.5",
"aws-amplify-react-native": "^2.0.5",
"native-base": "^2.7.2",
"react": "16.4.1",
"react-native": "0.56.0",
"react-native-prompt": "^1.0.0",
"react-native-vector-icons": "^5.0.0",
"react-navigation": "^2.11.2",
"react-redux": "^5.0.7",
"redux": "^4.0.0",
"redux-thunk": "^2.3.0"
},
Smartphone :
- Device: iPhone6
Let me know if you need further info. Thanks for looking into it
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:11 (4 by maintainers)
Top Results From Across the Web
No current user for authenticated user in Amplify
The error is literally saying No current user - you need to sign in using the supported identity ...
Read more >Authentication - Password & user management - JavaScript
It will throw an error if there is no user logged in. This method should be called after the Auth module is configured...
Read more >AuthClass | amplify-js
Defined in packages/auth/src/Auth.ts:817. This was previously used by an authenticated user to get MFAOptions, but no longer returns a meaningful response.
Read more >VerifyUserAttribute - Amazon Cognito User Pools
The verification code in the request to verify user attributes. Type: String ... This exception is thrown when Amazon Cognito encounters an internal...
Read more >Allow Users to Change Their Email - SST.Dev
This gets the current user and updates their email using the Auth module from Amplify. Next we render the form where they can...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@powerful23 How could that
Auth.resendSignUp
help if the username is auto generated? Currently, I’m generating username automatically and use email/phone number as alias to sign in. If user signs up with email and not enter the confirmation code right after the click the “Sign Up” button, and later tries to log in with email, he will getUser does not exist
. I’m thinking of a way to get the auto generated username from email (such as a Lambda) and use that instead of email for logging in. In that case, I’ll getUserNotConfirmedException
and I can show the confirmation screen for user to enter the code again. Is there any other better workaround? 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.