Laravel Sanctum SPA authentication

Viewed 92

I'm trying to setup a laravel api to work with a vue spa. API endpoints protected with auth:sanctum middleware only work when I add web middleware to them, which I don't think is right. Please help

1 Answers

False alarm, I had forgotten to add \Laravel\Sanctum\Http\Middleware\EnsureFrontendRequestsAreStateful::class, in app/Http/Kernel.php

Related