I’m currently using the universal login provided by Auth0 and I’m trying to access the state value which would allow me to redirect the user to their previous login state or more specifically the URL they were visiting prior to being authenticated.
It’s currently stored by the universal login in a format like the following:
com.auth0.auth.{value}: "{"nonce": {value} ] ,"state": {value} }"
As mentioned in the docs here:https://auth0.com/docs/protocols/oauth2/oauth-state
" You can also use the state
parameter to encode an application state that will round-trip to the client application after the transaction completes. In this way, the application can put the user where they were before the authentication process happened. For more information, see Redirect Users With State Parameters."
The issue I’m currently encountering is that I’m not sure what the best way would be to decode the state provided by the universal login. It seems like others are encountering the same issues and have mentioned this in prior posts:
- Lock v11 auth.params.state is not a valid Base64 value
- Reading state value in rules with hosted login - #2 by conan
Any guidance on how to best approach this would be greatly appreciated!