Next.js Discord

Discord Forum

Skip default signin

Unanswered
American black bear posted this in #help-forum
Open in Discord
American black bearOP
is there anyway to skip the default login page and go directly to discord auth from middleware.ts file?


export { default } from "next-auth/middleware"

export const config = { matcher: ["/communities"] }

1 Reply

It means you don’t want a sign in page at all?

1. Invoke the sign in function directly in a login button: signIn(“discord”)
2. Redirect the user to discord oauth url when they’re accessing the original signin page, you must copy the oauth2 url and paste it manually. Additionally instead of redirecting the user with custom middleware, change the default sign in url would technically works.
https://next-auth.js.org/configuration/pages