Search code examples
reactjsamazon-web-servicesnext.jsamazon-cognitonext-auth

In next-auth how to avoid the extra step "Sign In With Cognito" and directly go to the sign-in form?


In my Next.js project, when I use Cognito for sign-in (using the next-auth library), I get a first step of clicking a button that says "Sign in with Cognito". When that button is clicked, the sign-in form appears. How can I make cognito not show that first step of "Sign in with Cognito"? I need it to go straight to the Sign In. The step I want to skip: The step I want to go straight to:

Haven't found anything helpful in the Hosted UI page in Cognito (in the AWS console).


Solution

  • In your components where you call signIn() function to trigger authentication, use signIn('cognito') instead.