Skip to content
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

Amplify Auth - Password forget when not confirmed #7253

Closed
claudiorebernig opened this issue Nov 22, 2020 · 3 comments
Closed

Amplify Auth - Password forget when not confirmed #7253

claudiorebernig opened this issue Nov 22, 2020 · 3 comments
Labels
Auth Related to Auth components/category to-be-reproduced Used in order for Amplify to reproduce said issue

Comments

@claudiorebernig
Copy link

Describe the bug
When I sing-up a new user into my Congito userpool and not confirm him and then try to reset the password before confirming I am not getting an error, that the user is not confirmed. Rather I get a message that the code for the password reset was delivered, which is not the case.

To Reproduce
Steps to reproduce the behavior:

  1. Sign-up a new user into a congito userpool via web, android or ios amplify library
  2. Don't confirm the user
  3. Go for a password reset
  4. Success message that the password reset code was delivered when it was not

Expected behavior
Either I should get back an error like: "User needs to be confirmed first." or that the code is delivered and auto-confirms the account together with the new password.

Code Snippet
Web:
Auth.forgotPassword($phonenumber$)
.then((data) => {
....
})
.catch(err => ....)

Log from iOS
Optional(AWSMobileClient.SignUpResult(codeDeliveryDetails: Optional(AWSMobileClient.UserCodeDeliveryDetails(deliveryMedium: AWSMobileClient.UserCodeDeliveryMedium.sms, destination: Optional("+********XXXX"), attributeName: Optional("phone_number"))), signUpConfirmationState: AWSMobileClient.SignUpConfirmationState.unconfirmed))

What is Configured?
const cognito = {
REGION: "eu-central-1",
USER_POOL_ID: "XXX",
APP_CLIENT_ID: "XXX",
IDENTITY_POOL_ID: "XXX"
}

Amplify.configure({
Auth: {
mandatorySignIn: true,
region: cognito.REGION,
userPoolId: cognito.USER_POOL_ID,
userPoolWebClientId: cognito.APP_CLIENT_ID,
identityPoolId: cognito.IDENTITY_POOL_ID,
authenticationFlowType: 'USER_PASSWORD_AUTH'
}
})

Further info
I implemented user migration on the userpool.

I am using SMS to confirm the phonenumber of the user.

Smartphone (please complete the following information):
I have the problem on iOS & web, a collegue also got the problem on android

  • Device: iPhone XR
  • OS: iOS13
  • Browser: Google Chrome
@claudiorebernig claudiorebernig added the to-be-reproduced Used in order for Amplify to reproduce said issue label Nov 22, 2020
@amhinson amhinson added the Auth Related to Auth components/category label Nov 23, 2020
@vigneshvpai
Copy link

I can confirm this. When an unconfirmed user tries to reset his password he receives an OTP but when he submits the OTP he receives an ExpiredCodeException.

@harrysolovay
Copy link
Contributor

This is the correct behavior. One needs first confirm the sign up. As for the delivery message––I believe you're looking for the PreventUserExistenceErrors flag. Setting this User Pool config flag to false will allow you to see that the user does not exist (or is not verified) from the client.

@github-actions
Copy link

github-actions bot commented Dec 3, 2021

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 3, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Auth Related to Auth components/category to-be-reproduced Used in order for Amplify to reproduce said issue
Projects
None yet
Development

No branches or pull requests

4 participants