#Save JWT cookie from axios POST request for authentication.

3 messages · Page 1 of 1 (latest)

stark oar
#

Hey guys 👋,

I’m building an app using a Node.js backend server which provides me some APIs.
When I try to login to any account, the server has to send me a cookie and save it properly on the client side. But, when I try to make the request (with axios), it sends me a status code 200 with all of my data but it doesn’t save the JWT user token to browser cookies.

How can I fix this?
Thanks for your time 🙏

silent ocean
#

your using nextauth?

tardy mica
#

You can set the cookie when you get back the response. Read the headers on the response and save any cookies.