Auth.js · server log
MissingCSRF
[auth][error] MissingCSRF: CSRF token was missing during an action signin. Read more at https://errors.authjs.dev#missingcsrfWhat it means
A sign-in or sign-out POST arrived without Auth.js's CSRF cookie and token. Often it's a hand-rolled fetch to /api/auth/signin instead of the provided helpers.
Common causes
- fetch('/api/auth/signin/…', { method: 'POST' }) written by hand
- A form posting to the Auth.js endpoint from another origin
How to fix it
- Use signIn() from your auth.ts in a Server Action, or signIn from next-auth/react in a Client Component
- Don't call the /api/auth endpoints directly
import { signIn } from "@/auth";
<form action={async () => { "use server"; await signIn("github", { redirectTo: "/dashboard" }); }}>
<button>Sign in with GitHub</button>
</form>Prompt for Cursor or Claude Code
Auth.js logs MissingCSRF. Find any hand-written fetch or form that posts to /api/auth/* and replace it with signIn() from auth.ts in a Server Action.Not quite your error? Paste yours into the free VibeBoot Doctor or browse the Auth.js error fixer.
next: skip the next one
Skip the setup. The VibeBoot SaaS Starter ships Auth.js v5 already wired (GitHub sign-in, optional email magic links, Prisma adapter), plus Stripe and a database on Next.js 16.4.3. $49, one-time.
14-day money-back guarantee · lifetime updates
Other Auth.js errors
$ fixed it? get the next one first
New fixes for what AI agents break, by email.
When we add a fix or a Cursor rule for a new Next.js, Auth.js, Prisma or Stripe break, it goes out in the VibeBoot newsletter. Free, occasional, unsubscribe in one click.