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
Next.js polyfills the `fetch` on the server side to always cache (what's
known as their Data Cache) responses. Quote:
> Next.js has a built-in Data Cache that persists the result of data
fetches across incoming server requests and deployments. This is
possible because Next.js extends the native fetch API to allow each
request on the server to set its own persistent caching semantics.
>
> Good to know: In the browser, the cache option of fetch indicates how
a request will interact with the browser's HTTP cache, in Next.js, the
cache option indicates how a server-side request will interact with the
server's Data Cache.
This is _incredibly dangerous_ for Auth use cases. Thankfully, it
appears that using the default client uses `@supabase/node-fetch` in
such a circumstance which should not be affected by the issue.
However, if developers do choose to switch back to the native `fetch` in
Next.js the library must inform that HTTP client that there should be no
caching under any circumstance on Auth responses.
Opting out docs:
https://nextjs.org/docs/app/building-your-application/caching#opting-out-1
0 commit comments