diff --git a/docs/content/docs/integrations/next.mdx b/docs/content/docs/integrations/next.mdx index 93c4104d4b..1190c977a7 100644 --- a/docs/content/docs/integrations/next.mdx +++ b/docs/content/docs/integrations/next.mdx @@ -123,7 +123,7 @@ const signIn = async () => { ``` - `nextCookies()` auto-enables [`deferSessionRefresh`](/docs/concepts/session-management), so `GET` session reads stay write-free and RSC navigation never drifts the database session ahead of the cookie. The client re-issues the refresh as a writable `POST`. + `nextCookies()` auto-enables [`deferSessionRefresh`](/docs/concepts/session-management#defer-session-refresh), so `GET` session reads stay write-free and RSC navigation never drifts the database session ahead of the cookie. The client re-issues the refresh as a writable `POST`. Reading the session only on the server (no `createAuthClient`)? Set `session: { deferSessionRefresh: false }` to keep refreshing on `GET`. diff --git a/packages/better-auth/src/integrations/next-js.ts b/packages/better-auth/src/integrations/next-js.ts index 543ff518b4..0fbc281801 100644 --- a/packages/better-auth/src/integrations/next-js.ts +++ b/packages/better-auth/src/integrations/next-js.ts @@ -34,7 +34,7 @@ export const nextCookies = () => { // refresh would only drift the DB ahead of the stale cookie. The client // re-issues the refresh as a POST, where cookies are writable. The RSC // context cannot be detected from request headers. - // @see .postmortem/rsc-header-detection.md + // @see https://github.com/better-auth/better-auth/issues/9776 init() { // `defu` preserves an explicit user value, so this applies only when // `deferSessionRefresh` is unset. Escape hatch: set it to `false`.