Cookies sent by the nestjs server not set in the browser ()
Unanswered
Polar bear posted this in #help-forum
Polar bearOP
const response = await axios({
method: 'POST',
url: 'http://localhost:5000/auth/signin',
data: values,
headers: { 'Content-Type': 'application/json' },
});5 Replies
Black-and-white Warbler
Hello, having the same problem. Set all cors, sameSite none and secure true, ran next with local-ssl-proxy to run as https but still nothing
need to set
withCredentials: true, for axiosBlack-and-white Warbler
Yes, set this too, I've tested it more and it seems like it works for client components, but it doesn't for server components. I'm not sure how to handle this. Also found this: https://github.com/vercel/next.js/discussions/49843
Why use axios to begin with?
Next dedupes fetch by default. Use fetch.