auth0 / auth0-spa-js

Auth0 authentication for Single Page Applications (SPA) with PKCE

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Distinguish between Missing State and Invalid State

aveiros opened this issue · comments

Checklist

Describe the problem you'd like to have solved

Often users hit the back button and land on the callback url with callback parameters (code + state) and we have no way to know (?) when an "Invalid state" error was caused by missing state or invalid state (state mismatch).

We would like to take different routes depending on each of the scenarios above.

Describe the ideal solution

Maybe use GenericError with a different error property in order to distinguish these two scenarios.

Alternatives and current workarounds

None (? i believe).

Additional context

No response

Thanks for reaching out, I believe that's a fair request and opened a PR to accommodate for this.