Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auth.* cookie should not be set if the user isn't logged in #1846

Open
sdboer78 opened this issue Apr 19, 2023 · 1 comment
Open

Auth.* cookie should not be set if the user isn't logged in #1846

sdboer78 opened this issue Apr 19, 2023 · 1 comment
Labels

Comments

@sdboer78
Copy link

Version

module: 5.0.0-1667386184.dfbbb54
nuxt: 2.15.8

Nuxt-auth default behavior is to set an auth-strategy set-cookie header on each page-view. This results in page not being cached in caching systems.

Referring to:
#1029

Also CloudFlare has the default behavior to ignore caching when the application has a set-cookie in the response:
https://developers.cloudflare.com/cache/about/default-cache-behavior/#cloudflare-cache-responses:~:text=The%20Set%2DCookie%20header%20exists.
Its hard, or maybe even not possible to change this behavior.

So when using the nuxt-auth module no page will be cached in cache systems like CloudFlare, Varnish, Nginx-caching, Apache-caching, etc.

Nuxt-auth should not set any auth cookie when user is not logged in.

@sdboer78 sdboer78 added the bug label Apr 19, 2023
@cyppher
Copy link

cyppher commented Apr 19, 2023

+1

The set-cookie header has same impact as setting cache control headers to private, no-store, no-cache, or max-age=0. In effect Nuxt SSR now states cache should not be activated for this resource, even if it's a non protected page. Thus: bypassing the cache is a result of this header and should be resolved in this module imho.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants