2

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 Answer 1

1

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

Sign up to request clarification or add additional context in comments.

1 Comment

I am facing the same issue, but from what I understand I should be able to use sessions on API endpoints is that correct?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.