[Vuejs]-Laravel sanctum and vue: user is logged in frontend but backend returns unauthorized

0👍

I haved this problem.
This problem is for .env in backend laravel and get csrf front
remembering that the localhost address must be either localhost or 127.0.0.1 amd get csrf before

axios.get(‘/sanctum/csrf-cookie’).then(response => {
// Login…

}); 

.env
SESSION_DOMAIN=127.0.0.1
SACTUM_STATEFUL_DOMAINS=127.0.01:PORT

Leave a comment