question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Auth.forgotPassword does not work when user account status is "FORCE_CHANGE_PASSWORD"

See original GitHub issue

This might be a duplicate of 1182.

When a user is created through the JS/Node SDK using AdminCreateUser, they get an email with a temporary password. We have a common issue where a user does not log in before their temporary password expires or the user cannot find the email.

When a new user is created their “Account Status” is 'FORCE_CHANGE_PASSWORD' and we are setting email_verified to true.

It appears there is no way to reset the password using Amplify.Auth.forgotPassword. Unfortunately this puts us in a position where we have to resend the email through the CLI or manually reset the password in the AWS Console.

Ideally a user would be able to reset their password if their email is verified.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
elorzafecommented, Apr 4, 2019

@alspdx according to cognito docs.

The temporary password can only be used until the user account expiration limit that you specified when you created the user pool. To reset the account after that time limit, you must call AdminCreateUser again, specifying “RESEND” for the MessageAction parameter.

Currently there is no option for the library to do this. Is a server side problem that could implemented using a lambda function.

I will close this issue because a duplicate from #1182

We have an open RFC for auth enhancements here feel free to add this request or comments.

Thanks for your feedback!

0reactions
github-actions[bot]commented, Jun 12, 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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Amazon Cognito didn't send the forgot password verification ...
If the user status is FORCE_CHANGE_PASSWORD, then the ForgotPassword API call can't be used and the verification code isn't sent. Check how the ......
Read more >
Restore password for FORCE_CHANGE_PASSWORD status
NotAuthorizedException: User password cannot be reset in the current state. Is there any way to reset password in such state? AWS Collective.
Read more >
Authentication - Password & user management - JavaScript
The user is asked to provide the new password and required attributes during the first sign-in attempt if a valid user directory is...
Read more >
How to use the @aws-amplify/auth.forgotPassword function in ...
Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues...
Read more >
Signing up and confirming user accounts - Amazon Cognito
If you choose this option, Amazon Cognito doesn't send verification codes when users sign up. Choose this option if you are using a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found