I’m trying to add a login button to our lander page and after login I would like to redirect the user to our react application.
I added to our lander page and added handler on login button click which looks like this:
function() {
createAuth0Client({
domain: 'our-domain',
client_id: 'our-client_id'
}).then(function(auth0) {
auth0.loginWithRedirect({
redirect_uri: 'our-redirect_uri',
});
});
}
After I click a login button I’m redirected to auth0 login page I do log in and then I’m redirected to our react where we are using this react solution (https://github.com/auth0-samples/auth0-react-samples/tree/master/01-Login) and I’m getting this error:
Auth0Client.ts:285 Uncaught (in promise) Error: Invalid state
at e.<anonymous> (Auth0Client.ts:285)
at tslib.es6.js:99
at Object.next (tslib.es6.js:81)
at tslib.es6.js:73
at new Promise (<anonymous>)
at i (tslib.es6.js:69)
at e.handleRedirectCallback (Auth0Client.ts:268)
at react-auth0-spa.js:29
at l (runtime.js:45)
at Generator._invoke (runtime.js:271)
Can please someone help me solve this issue. Tnx.