Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CSRF token mismatch. #11

Open
menphurk236 opened this issue Oct 7, 2023 · 3 comments
Open

CSRF token mismatch. #11

menphurk236 opened this issue Oct 7, 2023 · 3 comments

Comments

@menphurk236
Copy link

image

run command : php artisan serve

my .env config
APP_URL=http://127.0.0.1:8000
SANCTUM_STATEFUL_DOMAINS=127.0.0.1:8000
SESSION_DOMAIN=localhost

@gdarko
Copy link
Owner

gdarko commented Oct 7, 2023

Hey @menphurk236

I have no idea what could be wrong because i don't use artisan serve.

I recommend to run this project with Laravel Homestead or Laravel Valet.

Best Regards,
Darko

@krishnahimself
Copy link

Hello @menphurk236,

I've added the following environment variables with these values:

APP_URL=http://localhost:8000/
SANCTUM_STATEFUL_DOMAINS=localhost:8000
SESSION_DOMAIN=localhost
SPA_URL="${APP_URL}"
This adjustment resolved the issue.

Best Regards,
Krishna

@fecoderchinh
Copy link

I have fixed this issue by change the browser url to http://localhost:8000
By default, if you press ctrl + click on the url on your terminal, then browser will open http://127.0.0.1:8000
This will cause the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants