Tutorials
Sanctum SPA Auth From Next.js — Step by Step
A no-magic walkthrough of how the cookie + CSRF dance actually works.
Super Admin··1 min read
Step 1 — CSRF
Call /sanctum/csrf-cookie. Set withCredentials. Read the XSRF cookie.
Step 2 — Login
Send X-XSRF-TOKEN. Laravel logs you in and rotates the session id.