Cannot utilize error messages from actions/hooks in universal login screen

I am trying to show a custom message for passwordless login, when a user enters an email that has been rejected as invalid from my preUserRegistration action. I am returning an error from this hook, but I can find no way to present that error to the user.

I have found many posts that suggest using:

languageDictionary = Object.assign(languageDictionary, {
           "error": {
              passwordless: {
               // User enters incorrect code
                invalid_user_password: 'That is not the code',
               // User does not enter code (i.e. leaves field blank)
                'bad.verification_code': 'No code provided',
                // invalid phone number
                'bad.phone_number': 'Please enter a valid phone number!!!'
              }
           }
       })

or something similar, to catch ‘bad.email’ errors but I’m not quite sure what triggers this, or how I can force the hook/action to return this error?

at this time, I am only able to present the user with “WE’RE SORRY, SOMETHING WENT WRONG” and no specifics, which is not helpful at all to users.

Can someone please help me to return meaningful errors to users when their login attempt fails in certain ways?

many thanks!

1 Like

I have the same issue and I’ll let you know if I find a workaround.

So far the docs simply say about the api.access.deny param

userMessage String. A human-readable explanation for rejecting the registration attempt. This may be presented directly in end-user interfaces.

So may be presented, for me it isn’t presented when using lock 11.

Yeah I can confirm that if you’re using New Universal Login with no customization html for login/signup widget, then you’ll see the error from api.access.deny.

If you’re customizing the html look/feel of the html, or using Classic login, then actions can only return a generic message, you have to use rules if you want a specific message there.

EDIT: I finally did figure it out here Pre-Registration Action calls api.access.deny, how to show specific message in Universal Login - #4 by jesse2

1 Like