Wangai
Wangai

Reputation: 684

Laravel Sanctum SPA authentication

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

Upvotes: 2

Views: 155

Answers (1)

Wangai
Wangai

Reputation: 684

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

Upvotes: 1

Related Questions