Hi everyone,
Our team’s goal is to add passwordless login option to an existing system. Due to some restrictions that are out of our control we could no use Okta’s Widget, so we decided to move on using okta-auth-js.
Once the use clicks a “send me an email”-like button we use idx’s authClient.idx.authenticate({...}) method to start the flow. Later, when they submit the OTP, we use authClient.dx.proceed({verificationCode: 'input'}) to check if it’s valid or not.
One of the scenarios we are struggling to handle is when the session expires. In this case, when we validate the OTP we get response with status PENDING and error ‘error.expired.session’. What we found checking the documentation is that we should ask the user to start the login process again.
In our case, it would end up running authClient.idx.authenticate({...}) to send a new e-mail. We would expect a new flow to be created and replace the old one, but what we receive is an error stating that ‘idx.session.experied’.
Is this expected? Are we forgetting to do some in between those steps?
I’ve tried to check the current flow ids with authClient.idx.getFlow() with no much success.