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
When I refresh the page it goes back to login page again. I notice that the auth.token and refresh token are not set in browser cookies. In my local or even in prod, when I set secureCookieAttribute and httpOnlyCookieAttribute to false, the tokens are added and everything works just fine. The problem only happens when I set TRUE secureCookieAttribute and httpOnlyCookieAttribute.
My backend where I call the api is using JWT and I also tried adding Set-Cookie: auth.token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9...; HttpOnly; Secure; SameSite=Lax; Path=/; Expires=<some expiration date> in the login api response.
Additional context
No response
Logs
No response
The text was updated successfully, but these errors were encountered:
Hi, is this issue being solved for. Because I'm in dire need of setting httpOnly cookies and setting httpOnlyAtrribute to true in nuxt.config.ts is just not working. If not then is there any workaround I can do for this, need to solve this as security risk asap? @zoey-kaiser
I am responably sure that this issue is a duplicate of #851. Therefore I would continue the discussion there around httpOnly not being correctly set!
@donn1123, one thing I noticed that in your nuxt.config.ts you are setting some values dynamically using process.env.NODE_ENV === 'production'.
The nuxt.config.ts gets compiled at build time (when you run nuxi build) and not at runtime (when you start the built application). Therefore if you do not set the NODE_ENV to production when building this could cause issues.
I cannot know if this could affect you, however I did just want to point out that pitfall, as it could create potenial issue 😊
Environment
Reproduction
Here's my auth setup in nuxt.config
auth: {
baseURL: '<API_URL>',
globalAppMiddleware: true,
},
Describe the bug
When I refresh the page it goes back to login page again. I notice that the auth.token and refresh token are not set in browser cookies. In my local or even in prod, when I set secureCookieAttribute and httpOnlyCookieAttribute to false, the tokens are added and everything works just fine. The problem only happens when I set TRUE secureCookieAttribute and httpOnlyCookieAttribute.
My backend where I call the api is using JWT and I also tried adding
Set-Cookie: auth.token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9...; HttpOnly; Secure; SameSite=Lax; Path=/; Expires=<some expiration date>
in the login api response.Additional context
No response
Logs
No response
The text was updated successfully, but these errors were encountered: