Customizing Error Messages Shown for Phone Enrollment - New Universal Login
Last Updated:
Overview
This article explains the source of the phone number validation and resulting error messages on the New Universal Login page when a user attempts to enter a phone number that is less than 4 digits, more than 30 digits, or contains characters.
One of the following errors may be seen:
Could not start voice call. Please try again later.
or
Could not send SMS. Please try again later.
Applies To
- New Universal Login Page
- Validation Error
Cause
Solution
Currently, the New Universal Login page performs the following validations before any further checks or hooks are called:
- The phone number (not including country code) has a minimum length of 4
- The phone number (including country code) has a maximum length of 30 (and the text field will only accept 30 characters)
- The phone number provided must only consist of digits
These validation steps and the resulting errors are not customizable.
However, if a custom hook is used for sending SMS or Voice calls, it is possible to use a custom error type for numbers that pass the basic validation mentioned above:
cb(new SendPhoneMessageError("CUSTOMIZED_ERROR_TEXT", err))
- It is also possible to use the
context.languageparameter available in hooks to localize this error