Skip SignIn page with next-auth.js to go directly to provider

Viewed 3006

I am using Okta with next-auth.js. Since I'm only using 1 providers (I will be using more providers inside Okta login), may I just skip this page and go directly to Okta login page? If yes, how? enter image description here

1 Answers

You can utilize signIn to skip directly to the provider sign in page

<button type="button" onClick={() => signIn([provider])}>Sign in with Provider</a>

Replace provider with the provider.id you want to use. In your scenario, it'll be signIn('okta')

refer: https://next-auth.js.org/getting-started/client#signin

Related