-
Notifications
You must be signed in to change notification settings - Fork 27k
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
How would I implement an authentication workflow? #148
Comments
React-Router v4 solves this by using the React component lifecycle directly ( |
Actually I correct that, it's solved like this: https://react-router.now.sh/auth-workflow |
#25 would resolve this issue too, since you can have any auth logics on your server. |
Also, to be perfectly clear, for most use cases you don't need #25. That'd be only necessary if you don't even want to ship the component code (not data) according to authentication rules. We perform authentication on |
Logged as #153 |
@rauchg A problem is you can't properly redirect unauthorized requests. |
@rauchg You store your sessions on api.zeit.co rather that on zeit.co correct? |
@rauchg what you do when the user is not authenticated? |
@rauchg can you elaborate on how you manage authentication in This makes sense to me for client side auth – could store token in browser. What about for when pages are rendered server side? E.g. with a |
@bhurlow you'll probably need a cookie. |
@luisrudge I ended up having the backend API manage the cookie placement |
Closing in favor of #153 |
I usually do a "onEnter" on React Router to check and redirect to a login page.
Running the check in getInitialProps? But that does not feel right...
The text was updated successfully, but these errors were encountered: