Log User In Immediately After Entering Passwordless Code

I’m using a passwordless, code-based flow to sign new users up in my NextJS application.

Currently, after signing up, users will receive a verification code. After entering that, they request another code to sign in.

Is it possible to log a user in immediately after they’ve entered their verification code, reducing the two-step process to one?

Hi @jeremy.gray,

Generally, users are automatically logged in after they sign up. I’m curious why the user is being prompted to request another code to sign in.

Could you please explain why users are requesting a second code to sign in? Is this part of the MFA process or a repetition of the Passwordless OTP flow?


Hi @rueben.tiow , apologies, I should have provided more details about my implementation.

I use the Username-Password-Authentication connection as the primary identity store. When a user signs up, a user is created in that connection, and their user ID is stored in my database. This ID, along with their email address, are the primary properties used to identify users within our system.

I added the passwordless flow to streamline the signup and sign in process. However, if a user authenticates with the passwordless flow, their user ID in the access token doesn’t match the one in our system, since their identity in our system is tied to the Username-Password-Authentication ID. My solution to this is to link their email and UPA identities.

This linking, however, prevents the user from using a single code to sign up and sign in.