Reputation: 580
Frond-end: React (react-admin) with Webpack
Back-end: NestJS / Express
I developed 3 routes (login, check and logout) that are beautifully working with Swagger UI, but when I try to use the 'login' route in my login page it doesn't save the cookie in the browser > application > storage > cookies
I'm setting the cookie on the back end with this code:
response.cookie('tk', 'Bearer ' + token, {
domain: hostname, // localhost or 127.0.0.1
path: "/",
expires: oneMonthFromNowDate,
httpOnly: true,
secure: false,
sameSite: true
});
And in the front end I'm receiving a successfull response with the cookie assigned:
But it is not saving in the browser > application > storage > cookies!
Upvotes: 0
Views: 727
Reputation: 580
Looks like I was missing some kind of configuration...
Solved using Axios with "credentials: true" option.
Upvotes: 1