1

I am using Next-Auth for authenticating my app. I wanna know if it's possible to add custom values to the Callback error object that gets returned when something goes wrong with SSO authentication. Right now Next-Auth returns me to the login page, passing "?error=Callback" as query parameters.

Since I want to do custom error handling (something went wrong, user is banned etc.), I wanna know if it's possible to handle situations like this using Next-Auth.

This is the error object

Anargyros Stylidis
  • 229
  • 1
  • 3
  • 13
  • Does this answer your question: [How to handle login failed error in NextAuth.js?](https://stackoverflow.com/questions/70165993/how-to-handle-login-failed-error-in-nextauth-js)? – juliomalves Apr 08 '22 at 17:41
  • This example is using "Credentials" sign in. I want to do the same but using SSO login (NextAuth first redirects to the provider's web page then back to my app). The error object just has the callback error string. – Anargyros Stylidis Apr 11 '22 at 07:13

0 Answers0