Different cache logic for next-auth #28
Replies: 2 comments 12 replies
-
To be honest, even I am fairly confused about this (I, frankly, have never used Not sure what it should be, but I will trace the change to /api/auth/*, investigate the problem with |
Beta Was this translation helpful? Give feedback.
-
I noticed the same thing. To disable caching for all This worked for me: // src/app/sw.ts
import { defaultCache } from '@serwist/next/browser'
import { installSerwist } from '@serwist/sw'
installSerwist({
//...
runtimeCaching: [
{
urlPattern: /\/api\/auth\/.*/,
handler: 'NetworkOnly',
options: {}, // needed to avoid serwist crash
},
...defaultCache,
],
}) |
Beta Was this translation helpful? Give feedback.
-
Hey, I recently migrated from next-pwa to serwist, so far so good, then I noticed some increase in the next-auth
OAuthCallback
error.I was doing some comparison and the cache files are different, so I wounder what was the reason to change from:
(return false for any /api/auth)
https://github.com/shadowwalker/next-pwa/blob/1e6af5fa9f6a807930f451adb5ab5078d5cda451/cache.js#L136
to
(return false only for /api/auth/callback)
serwist/packages/next/src/index.browser.ts
Line 144 in 008d794
For now I'm passing the previous logic and it seems stable (still monitoring), but posting here to get + context.
Beta Was this translation helpful? Give feedback.
All reactions