Hi @aajmera - if I understand you correctly, the steps to reproduce your issue are:
- Run the application
- visit
http://localhost:3000/user
with no cookies - Login and return to the application
- expect to be returned to
/user
- actually returned to/authenticated
If this is the case, then this is casued by simple-auth0/index.js at master · ajmeraaxesh/simple-auth0 · GitHub
When you return to the application after login, you are returned to the home page to process the state and redirect you to your state.returnTo
(if specified). Since you have a router.push('/authenticated')
in your home page’s render that happens after authentication - the user is redirected to /user
as expected, then the code in the the homepage overrides this and redierects the user to authenticated
.
I commented out the router.push('/authenticated')
in simple-auth0/index.js at master · ajmeraaxesh/simple-auth0 · GitHub and the application retuned me to /user
after login as expected