Redirecting Straight to Auth0 Hosted Login Page

Hi, I’ve been trying to redirect immediately to the hosted login page without a preliminary page. When I run the code it takes me directly to the hosted login page, but after logging in it takes me back to the hosted login page. If I login again it takes me inside my application. I don’t understand why my first login attempt fails. My code is based on the Auth0 react tutorial. const handleAuthentication = ({ location }) => { if (/access_token|id_token|error/.test(location.hash)) { auth.handleAuthentication(); } } export const makeMainRoutes = () => { if (!auth.isAuthenticated()) {

auth.login()
} return (

 <Route path="/" render={(props) => <App auth={auth} {...props} />} />

 <Route path="/home" render={(props) => <Home auth={auth} {...props} />} />
 <Route path="/callback" render={(props) => {
   auth.handleAuthentication(props);
   return <Callback {...props} />
 }} />
 <Route path='/stories' component={StoryPage}/>

); Any input would be appreciated.

As it has been more than a few months since this topic was opened, and there has been no reply or further information provided as to the existence of the issue, we are closing this topic. Please don’t hesitate to create a new topic if this issue is still present, we would be happy to work with you to help find a resolution.