mirror of
https://github.com/hanzo-apps/dataroom.git
synced 2026-10-30 14:47:36 +00:00
The name carries a __Secure- prefix over https, and NextAuth derives that from NEXTAUTH_URL in both directions — when it writes the cookie, and in getToken when the middleware reads it. Naming it here broke that agreement: the name was keyed to VERCEL_URL, unset off Vercel, so the app wrote `next-auth.session-token` while the middleware looked for `__Secure-next-auth.session-token`. Signing in worked perfectly the whole time — a real session, a real cookie, /api/auth/session returning the user — and every guarded route still bounced to /login, which looks exactly like a rejected password. The override existed to pin a Vercel apex domain; nothing here is on Vercel.