-
Notifications
You must be signed in to change notification settings - Fork 4k
Closed
Labels
questionAsk how to do something or how something worksAsk how to do something or how something works
Description
Question 💬
I am using next-auth for login. When I use provider oauth login (ex : discord), cancel of discord login redirect to (/api/auth/signin?error=Callback). But considering user experience, it is good to redirect origin url. So I wonder why OAUTH_CALLBACK_HANDLER_ERROR redirect to signin error page. And OAUTH_CALLBACK_HANDLER_ERROR is related to another error excepting Cancel. If not I want to add some options in provider that go back to origin url if user just cancel Oauth login
How to reproduce ☕️
related next-auth code
if ((error as Error).name === "AccountNotLinkedError") {
// If the email on the account is already linked, but not with this OAuth account
return {
redirect: `${url}/error?error=OAuthAccountNotLinked`,
cookies,
}
} else if ((error as Error).name === "CreateUserError") {
return { redirect: `${url}/error?error=OAuthCreateAccount`, cookies }
}
logger.error("OAUTH_CALLBACK_HANDLER_ERROR", error as Error)
return { redirect: `${url}/error?error=Callback`, cookies }
Contributing 🙌🏽
Yes, I am willing to help answer this question in a PR
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
questionAsk how to do something or how something worksAsk how to do something or how something works