Authorization between nuxtjs and the backend API Authorization between nuxtjs and the backend API vue.js vue.js

Authorization between nuxtjs and the backend API


Cookies are exposed in the (Express) Nuxt server through middleware.

Specifically, they can be read from the req.headers.cookie property. You can see an example implementation of this in the Nuxt documentation.

Regarding your implementation: fetching the privileged data from your API using Node would seem to be the ideal way to delegate session handling to that single service (rather than both) and provide SSR for your users.

If you've chosen to instead implement your session handling on the Django service then you'll need to "forward" your cookies by passing them into your axios request headers.


I did something similar using Firebase authentication. There is an example project on Github as well as a blog entry outlining the important files and configuration used in the application.