-
-
Notifications
You must be signed in to change notification settings - Fork 21
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 error on 0.4.15 #188
Comments
Let's check what is the problem here 😄 May I ask you to:
|
Sure :-) This is the output on the terminal while running the app. This is the initial request. On the login-request, there is no log written:
This is the log that is sent to the browser console when clicking the login-button:
and
|
@ahoiroman version P.S. clear the cookies just in case |
Unfortunately it's still the same problem. I cleared cookies, disabled anything that could interfere the connection (VPN, AdGuard, ...) and installed a fresh browser. I validated the fact that I got the most recent version:
This is the browser-console-output after clicking "login": These are the headers that laravel/telescope reports:
And those are all logs:
|
Before you dig deeper, let me validate cors etc using postman. While debugging the initial problem, I was adapting quite a bit. |
Hm. Nope. No matter what I do: Without the X-XSRF-TOKEN, the request will always fail at https://github.com/laravel/framework/blob/11.x/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php#L154 . |
@ahoiroman thanks, got it, I will try to look into that. Does it happen with CSR mode as well? |
Yes, it does hapen with |
You can try to downgrade to stable 0.4.12 in the meantime, I will keep you posted |
I published a new Please let me know if |
I created reproducers:
These are fresh projects to make sure that no custom logic causes the problems. |
Bildschirmfoto.02.10.2024.-.10h.38min.49s-converted.mp4Video in full quality is available here: https://share.cleanshot.com/Y4hrdmpm |
Hey @ahoiroman but in the |
@ahoiroman I have just checked the video and everything looks valid (token, headers), to be honest, what is your |
Sorry, I did not push the latest change to the backend project because phpStorm detected an issue and did not push the commit. The readme contains a sample
|
Could you also add I will try to set up your repros later today |
I added these values to Best, Roman |
@ahoiroman |
🚀 That fixes the problem! |
And of course: Thank you (again) for your great work! |
Describe the bug
After upgrading to 0.4.15, I am getting an csrf-token mismatch error when I try to login.
Expected behavior
Login should happen
Actual behavior
The initial request to get a csrf-token is returned with 204:
The request to
/login
returns 419:This is the payload:
These are the headers:
Sure enough,
X-XSRF-TOKEN
is missing.The Laravel sanctum docs do say that this is required:
https://laravel.com/docs/11.x/sanctum#csrf-protection
Module information
0.4.15
Nuxt environment:
The text was updated successfully, but these errors were encountered: