Persist a value through a login (set value in state?)

Hello! I’ve been reading @auth0/auth0-spa-js and I’m having a hard time trying to figure out how to set the state property so that after a user logs into auth0 the state object can be read and utilised after the login.

We have persist a value that we are not allowed to lose and must come from that specific login flow, we can’t store it in local storage/cookies for specific reasons.

I’m currently thinking of putting a custom value as a query parameter but this isn’t exactly safe: redirect_uri: location.href + '?myKey=myValue'

Our team is answerinfg some of our most frequently asked questions.

Additional parameters can be included in the /authorize request and later accessed in the Login Page Template via transaction.params.

Please note that for custom parameters to be accessible, they must be prefixed with ext-.

export default handleAuth({
   login: handleLogin({
     authorizationParams: { ext-customParam: 'foo' } // Pass custom parameters
   })
});

For more details, you can refer to the following documentation:

Hope this Helps!

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