Browser back button issue

After login into the application from Okta, and entering the application home page, immediately when the user clicks on the browser back button getting an Okta error like

“AuthSdkError: Could not load PKCE codeVerifier from storage. This may indicate the auth flow has already been completed or multiple auth flows are executing concurrently”. But In real cases, it should navigate back to the login page.

The browser URL is showing like a callback component URL, but OKTA provides this by default callback component.

So how can I handle this scenario as the usual browser back button process?

We do have some historical discussion on this issue that may be worth reviewing as potential solutions to prevent this error depending on the cause (which in this case is hitting that back button):

I have the same issue. Success login → click back → PKCE screen. (Same as described in the first message)

Any updates how can we fix it?

I’m sorry but your reply doesn’t help with anything.

The first issue you linked is about the same problem, but in their case it just stopped reproducing for some reason.

The second is not relevant and is closed as “not-reproducible”, no solution was suggested.

That error occurs because the PKCE codeVerifier isn’t written to the localStorage location expected. This can happen for a few different reasons – multiple instances of authjs on the page, multiple browser redirects, the same app is open in multiple tabs, etc. Are you using the default storageManager configuration?

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.