How to handle cancelled login, when using nextAuth OAuth?

Hi there! I'm using the T3 stack for the first time and was having trouble handling the OAUTH_CALLBACK_HANDLER_ERROR when cancelling the signIn flow using OAuth.

My users will signIn (e.g. via Discord) and will be greeted with the Discord login page, but if I were to cancel the OAuth flow, I am redirected to http://localhost:3000/api/auth/signin?error=Callback where I can once again sign in via Discord and I get an error in my console.

The proper functionality I want is to redirect my user back to the login page. Thanks!
unknown.png
unknown.png
unknown.png
Was this page helpful?