This means my login token cannot be retrieved by larafetch just by response.token. I need to change it to response.data.token as the token is part of the data object.
But how do I do this? I cannot find a single line of code where you set the Laravel Sanctum auth token to the header of the user. I can only see lines which are about the XSRF-Token.
Hey there,
I have modified my backend and instead of just returning the
token
when the login route is called my backend returns such a response:This means my login
token
cannot be retrieved bylarafetch
just byresponse.token
. I need to change it toresponse.data.token
as thetoken
is part of thedata
object.But how do I do this? I cannot find a single line of code where you set the Laravel Sanctum auth token to the header of the user. I can only see lines which are about the
XSRF-Token
.I highly appreciate any kind of help!
Kind regards