Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AWS Amplify: How to resend code when Auth 'signIn' API returns 'UserNotConfirmedException'

I have an unconfirmed aws cognito user which did not verify his email during registration process. When he tries to login with following code:

Auth.signIn({
    username:email,
    password:password,
})


the API returns

'UserNotConfirmedException'

Now at this point the user is unauthenticated, there is no current session or current user. How will this user be able to verify himself and get himself logged in?

'verifyCurrentUserAttribute' and 'resendSignUp' APIs do not work for unauthenticated user.
Please help.

like image 625
Shahid Iqbal Avatar asked Dec 08 '25 23:12

Shahid Iqbal


1 Answers

Late response but just saw this: The Auth.resendSignUp(<username>) does not need an authenticated user and is suited for this purpose. It accepts a username parameter as a string and when called will send a new code to the method configured in Cognito.

like image 82
spooky123 Avatar answered Dec 14 '25 22:12

spooky123