Wrong verification code for passwordless login shows "WE'RE SORRY, SOMETHING WENT WRONG" message to user

When the user types an invalid code in lock it shows the error “WE’RE SORRY, SOMETHING WENT WRONG”.

Looking at the network trace – the server responds with:
{"error":"invalid_user_password","error_description":"Wrong email or verification code."}

Looking at the github code: https://github.com/auth0/lock/blob/8693831e5b62090178d657e99da0ed18ecae1277/src/i18n/en.js#L39

It seems that there is no key for the invalid_user_password.

What is the recommended strategy to provide a better error message to the user?

Thanks.

Hi @Joe-FS,

You can customize Lock error messages via the Language Dictionary.

For example:

languageDictionary = { 
        title: config.dict.signin.title,
        error: {
          passwordless: {
           // User enters incorrect code
            invalid_user_password: 'Wrong password',
           // User does not enter code (i.e. leaves field blank)
            'bad.verification_code': 'Bad verification code'
          }
        }
      };

Screen Shot 2021-01-15 at 14.15.26 Screen Shot 2021-01-15 at 14.08.50

2 Likes

Awesome will give that a shot.

Guidance is much appreciated!

1 Like

Hey there!

Have you had a a chance to test it out?

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.