Custom Database Login Script Does Not Display Errors

Overview

Errors from a custom database login script are not displayed to the end user in the front end.

Applies To

Custom Database Login Scripts

Cause

The Error() constructor does not return the custom error message to the front end.

Solution

To communicate errors from custom databases to the front end, use the following constructors:

  • For errors that occur when an issue arises while trying to reach the database. This is the preferred method for communicating errors from custom databases to the front end.

new UnauthorizedError(<message>)

 

  • For errors that occur when the user's credentials are invalid.
new WrongUsernameOrPasswordError(<email or user_id>, <message>)

Recommended content

No recommended content found...