I have my laravel backend running on backend.domain
I have a vuejs spa trying to logging in from 'external.app.domain'
I need that vuejs spa can login, obatain A NEW token for the user, to, then, use for subsequent calls.
I am following this: https://laravel.com/docs/9.x/sanctum#csrf-protection
The call to sanctum/csrf-cookie works, but I got this from chrome
Axios in vue app is using
withCredentials: true,
Backend cors.php file has
'supports_credentials' => true,
Backend sanctum.php file has external.app.domain
in the stateful
array
The problem is that calling /login to obtain a token I got this
CSRF token mismatch.
What else must I do !?
SOLVED
I had to remove the middleware of sanctum in api. I previously enabled because I was trying other way to use Sanctum itself.