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.

user.completeNewPasswordChallenge is not a function

See original GitHub issue

Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior:

  1. Use flat aws-exports.js structure
  2. Set Cognito up such that Only Admin creates accounts
  3. Use Amplify but not mobile hub
  4. Create an account
  5. try to change the temporary password using Auth.completeNewPassword(userFromLoginAttempt, newPassword, requiredAttributes)
  6. Responds with user.completeNewPasswordChallenge is not a function

Expected behavior Password is changed and the user can login

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: MacOS
  • Browser: Chrome
  • Version: 1.0.0

You can turn on the debug mode to provide more info for us by setting window.LOG_LEVEL = ‘DEBUG’; in your app.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:22 (2 by maintainers)

github_iconTop GitHub Comments

6reactions
nikhilknolduscommented, Sep 14, 2020

You can simply use the predefined amplify method like below. const currentUser = await Auth.currentAuthenticatedUser();

5reactions
powerful23commented, Sep 24, 2018

@goatandsheep When you get resolved from Auth.signIn() with that user object, you are not actually signed in because you need to complete the new password. So at that moment Auth.currentSession and Auth.currentAuthenticatedUser won’t work because you are not signed in. You need to directly use that user object returned from Auth.signIn() to help you finish the login process.

Read more comments on GitHub >

github_iconTop Results From Across the Web

AWS amplify auth.completeNewPassword() doesn' work
When I try to update the password. I get this error. TypeError: user.completeNewPasswordChallenge is not a function at Auth.js ...
Read more >
CognitoUser.completeNewPasswordChallenge - Javascript
How to use. completeNewPasswordChallenge. function. in. CognitoUser · Best JavaScript code snippets using amazon-cognito-identity-js.CognitoUser.
Read more >
[Solved]-AWS Cognito completeNewPasswordChallenge calls ...
Coding example for the question AWS Cognito completeNewPasswordChallenge calls onFailure method but the user is confirmed in AWS Console-Reactjs.
Read more >
RespondToAuthChallenge - Amazon Cognito User Pools
You create custom workflows by assigning AWS Lambda functions to user pool triggers. When you use the RespondToAuthChallenge API action, Amazon Cognito invokes ......
Read more >
Reactjs – AWS Cognito completeNewPasswordChallenge ...
I have a user that was created in the AWS Console by an admin, ... and when I call the completeNewPasswordChallenge function with...
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