I am using NextAuth for my NextJS application. When using NextAuth, it redirects to its own sign-in page when signing in or we can add our own custom sign-in page but what I want to do is sign-in without redirecting it to the sign-in page directly from the homepage login button. Any ideas on how can I achieve that?
I think you can do something like this ...
import { signIn } from "next-auth/client"
export default () => (
<button onClick={() => signIn("google")}>Sign in with Google</button>
)
So you can use pass any OAuth provider that are compatible with NextAuth to signIn and it will use that provider by default instead of redirecting you to a page.
Thanks