Customizing Lock Error Messages


You can customize the error messages that will be displayed in certain situations by providing a languageDictionary option. A full listing of available languageDictionary fields to customize can be found in the GitHub repository's English Dictionary file for Lock v11. Below is an example of some customized error messages:

// Examples of customized error messages in the languageDictionary option
var options = {
  languageDictionary: {
    error: {
      login: {
        "lock.invalid_email_password": "Custom message about invalid credentials",
        "": "Custom message indicating a network error and suggesting the user check connection",
        "lock.unauthorized": "Custom message about a failure of permissions",
        "too_many_attempts": "Custom message indicating the user has failed to login too many times."
      signUp: {
        "invalid_password": "Custom message indicating a password was invalid",
        "user_exists": "Custom message indicating that a user already exists"

// Initiating our Auth0Lock
var lock = new Auth0Lock(

If you are returning custom error codes from a rule or a custom database script, you can also add the error messages in the dictionary:

//custom database script: getUser
function getByEmail (email, callback) {
  callback(new ValidationError('custom-error-code', 'Some custom message'));
languageDictionary: {
  error: {
    forgotPassword: {
      "custom-error-code": "Your custom error message"

These errors will be shown on the widget header.