I try to access my Laraval API from my Vue SPA but everytime I do a request I get a 401 Unauthorized. I have tried the answers from multiple SO questions but nothing works.
- I added the
EnsureFrontendRequestsAreStateful
to the API middleware. - I set the Valet domain that I use for
SANCTUM_STATEFUL_DOMAINS=goya.app
. - I set the session envs:
SESSION_DRIVER=cookie SESSION_LIFETIME=120 SESSION_DOMAIN=.goya.app
- In Vue I have
axios.defaults.withCredentials
enabled. - In the request headers I see that the XSRF token is sent.
What else can I try to fix this?