Reputation: 127
My laravel sanctum - vuejs authentication system works fine ibn localhost. But It does not work in live server. I have tried with various env configurations - but nothing is happening ... My domain has SSL btw
My ENV :
APP_NAME=Laravel
APP_ENV=Production
APP_DEBUG=true
APP_URL=https: // domain.com /
LOG_CHANNEL=stack
LOG_DEPRECATIONS_CHANNEL=null
LOG_LEVEL=debug
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=*****
DB_USERNAME=*****
DB_PASSWORD=*****
BROADCAST_DRIVER=log
CACHE_DRIVER=file
FILESYSTEM_DRIVER=local
QUEUE_CONNECTION=sync
SESSION_DRIVER=cookie
SESSION_LIFETIME=120
SESSION_DOMAIN=domain.com
SESSION_SECURE_COOKIE=false
SANCTUM_STATEFUL_DOMAINS=domain.com
I am sharing the request header :
Upvotes: 0
Views: 280
Reputation: 127
I found the solution. So I am answering it here so that people with similar problems get benefited. I was using Auth middleware for API protection but implemented manual authentication in the controller instead of default Auth. That causes the problem since the frontend could not match the cookie "Auth" produces.
Upvotes: 1