Pain point · API & developer experience · Blocks work
getUserByCookie fails in Next.js middleware
2 source threads · first seen 2021-11 · last seen 2024-05
Summary
The server-side cookie user lookup does not work in Next.js middleware because it hits an XMLHttpRequest error, and the message is unclear.
- Affects
- Next.js developers
Evidence
Excerpts are copied word for word from the source; follow the link to read it in full.
“[AuthSessionMissingError: Auth session missing!]”
“`supabase.auth.api.getUserByCookie()` doesn't work in Next.JS server-side environment (`_middleware.ts`)”