Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

like image 293
Boubou Avatar asked Feb 27 '21 18:02

Boubou


Video Answer


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

like image 106
crrmacarse Avatar answered Oct 07 '22 15:10

crrmacarse