0

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 :

enter image description here

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.