You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Nuxt provides a fetch method on page components to prefetch data server-side. The same method is called by the browser if you navigate to it after it's initialised (I believe). The trouble is that when it's executed by the server, it doesn't include the cookies with the request, and gets a 401 Unauthorized response. Not sure how to solve this.
Frankly, if we can't get this to work, I'm not sure what the advantage of using SSR/Nuxt.js is relative to the trade-offs I've experienced with it so far.
The text was updated successfully, but these errors were encountered:
Someone in nuxt discord channel recommended I instantiate axios in a plugin, which has access to context, and pull in the cookie header there. I'd have to refactor the store/api to pass down the axios instance.
Nuxt provides a
fetch
method on page components to prefetch data server-side. The same method is called by the browser if you navigate to it after it's initialised (I believe). The trouble is that when it's executed by the server, it doesn't include the cookies with the request, and gets a401 Unauthorized
response. Not sure how to solve this.Related:
Frankly, if we can't get this to work, I'm not sure what the advantage of using SSR/Nuxt.js is relative to the trade-offs I've experienced with it so far.
The text was updated successfully, but these errors were encountered: