Now, i go to login page, click login, it comes back to login page . But, when i dont protect this route and I have it unprotected
It works perfectly and after login, i go to this Apphome component.
I am using react.js and auth0 . What’s the issue here?
Thanks in advance
<Router history={history} component={App}>
<div>
<Route path="/login" render={(props) => <Login auth={auth} {...props} />} />
<Route path="/apphome" render={(props) => (
!auth.isAuthenticated() ? (
<Redirect to="/login"/>
) : (
<Apphome auth={auth} {...props} />
)
)} />
<Route path="/contacts" exact component ={Contacts} />
<Route path="/mytodo" exact component ={Mytodo} />
<Route path="/favorites" exact component ={Favorites} />
<Route path="/mention" exact component ={Mention} />
<Route path="/profile" exact component ={Profile} />
<Route path="/buy" exact component ={Buy} />
<Route path="/success" exact component ={Success} />
<Route path="/cancel" exact component ={Cancel} />
</div>
</Router>