-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Best way to restrict pages to logged in users only #276
Comments
I followed this tutorial, https://auth0.com/blog/2015/04/09/adding-authentication-to-your-react-flux-app/ worked good :) |
@simtechmedia can you give full example on what you implement ? |
In my case, I use redux. async action({ store }) {
const { user } = store.getState();
if(null === user) return { redirect: '/login' };
(...)
} |
Oh I forgot all about this. In the end I just validated with a token, and redirected users if the response from the API was a 403. |
Any pointers on redirecting users who try to access a route that is for logged in users only? Here's what I have so far in routes.js:
I feel like the redirection should happen somewhere in this file, rather than inside somewhere, is it something to do with the
on('error'...
function? Though I'd rather redirect users to a login page and not a 404.Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
The text was updated successfully, but these errors were encountered: