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
Guide on handling protected SSR api requests #334
Comments
this is seemingly still an issue that's not documented? I'm happy I searched and stumbled into a closed issue that looks unresolved - at least I'm not alone ;) |
I just ran into this issue today. and was scratching my head for hours, trying to figure out why express loses session on SSR. :( |
JUST FYI: I have transitioned to using JWT tokens. Makes it much simpler to not have to deal with sessions. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
A bit tricky of a question but here's the scenario. Also, sorry for posting here if not the correct project. Wasn't sure which repo to post under.
Using Nuxt with Express
This works without an issue from the browser's point of view as cookie/session can be detected. However, when the fetch hook is triggered from the server, cookie/session is lost. Following the, https://nuxtjs.org/examples/auth-routes/ is insufficient.
ie: if your protected route looks like
Nuxt renderer will throw a 401 error as the hook call to the protected route will not contain the user session.
There are many solutions/workarounds here
There may be others but probably in the realms of either or.
The text was updated successfully, but these errors were encountered: