Custom Database Login Script Does Not Display Errors
Last Updated:
Overview
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>)