Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

272
Views
Angular - AWS Amplify amplify-authenticator crashes the form when the 'Code' I send is wrong

I have an amplify-authenticator form which I use to reset the password. If I enter a wrong code, I get a response from the API which says

CodeMismatchException: Invalid verification code provided, please try again.

which is correct, but the entire form then freezes and I also get this message in the console of the browser:

Error: Uncaught (in promise): TypeError: Cannot read properties of undefined (reading 'authAttributes') TypeError: Cannot read properties of undefined (reading 'authAttributes') at actorDoneData (index.js:2:34774)

which points to webpack:///node_modules/@aws-amplify/ui/dist/esm/index.js

This is the code I have:

HTML

<amplify-authenticator [services]="services" initialState="resetPassword"></amplify-authenticator>

TS

    this.services = {
      async handleForgotPasswordSubmit(formData): Promise<void> {
        const { username, code, password } = formData;

        return Auth.forgotPasswordSubmit(username, code, password)
          .then(res => {
            //  Do something on success
          })
          .catch(err => {
            // The ERROR is here
            console.log(err);
          });
      }
    };

Please advise what can I do to avoid the form freeze problem. Thanks!

EDIT: It seems that if I remove the .catch from the promise, the problem disappears.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!