WEDNESDAY, JULY 29, 2026 48° E  /  GLOBAL TECH · SUMMARISED SUBSCRIBE
AI, business, devices, policy — global tech, summarised every 30 minutes.
Dev Tools · 2h ago

Fix Laravel Sanctum 401s in Nuxt SSR by forwarding cookies

By Meridian48 News Desk · Summarised from DEV Community ·

Server-side rendering in Nuxt causes 401 errors with Laravel Sanctum's SPA cookie auth because the server-side HTTP client lacks cookies, Origin headers, and proper URL resolution. The fix involves forwarding the incoming request's Cookie header and Origin via useRequestHeaders and useRequestURL. This ensures Sanctum recognizes the server-side request as stateful and authenticates it correctly.

Meridian48 take
A common SSR pitfall that's well-documented but easily missed — the fix is straightforward once you understand that server-side requests are essentially a different client.
Read the full reporting
Laravel Sanctum with Nuxt SSR: why the session disappears on the server →
DEV Community
laravel-sanctumnuxt-ssr
More dev tools briefs
Go deeper on dev tools
AllAIStartupsBusinessDevicesPolicySecurityDev ToolsPakistan