Next.js Discord

Discord Forum

How to throw custom error message from authorize() instead of "CallbackRouteError"

Unanswered
iC0d3X posted this in #help-forum
Open in Discord
Hello,

I'm using Auth.js (5.0.0-beta.4) and wanted to know if it's possible to throw custom error messages in the authorize instead of "CallbackRouteError".

 
async authorize(credentials) {
    if(!credentials) {
        throw new Error("TESTTEST");
    }
}

This throws CallbackRouteError: Read more at https://errors.authjs.dev#callbackrouteerror.

0 Replies