Next.js Discord

Discord Forum

NextAuth Google Provider Callback Issue

Snowshoe posted this in #help-forum
Open in Discord
Hello everyone,

I'm currently working on a Next.js website and I'm using NextAuth for authentication. I've set up Google as a provider and everything works fine until the point where the user is asked to either "Continue" or "Cancel" during the Google login process.

When the user chooses to "Cancel", instead of being redirected to the homepage of my site, they are taken to https://mywebsite/api/auth/signin?error=Callback. I would like to change this behavior so that upon cancellation, the user is redirected to the homepage.

How can I achieve this? Thanks in advance.

0 Replies