#Auth sanctum is redirecting routes (302)

4 messages · Page 1 of 1 (latest)

frail pumice
#

I dont know exactly what i am doing wrong but i noticed that all XHR Requests from the JS file towards the api (auth:sanctum protected routes) do get redirected to the front page with a 302. I suspect it has something to do with the CSRF logic, however every request that gets send out from JS has the token included.

Any idea why this is happening?

timber rapids
#

set Accept header application/json

xsrf-token also needs to be sent as a X-XSRF-TOKEN header

frail pumice
#

It was the missing "Accept" header, but now i do get an 401 unauthorized.

#

There seems to be no difference whether i send an "X-XSRF-TOKEN" or "X-CSRF-TOKEN" header with the token