amrnn90 / breeze-nuxt

An application / authentication starter kit frontend in Nuxt3 for Laravel Breeze.
MIT License
198 stars 33 forks source link

There is a csrf problem when calling login via post action on the productions environment. #30

Closed mydidefix closed 7 months ago

mydidefix commented 8 months ago

When accessing https://example.com/login an error occurs message "CSRF token mismatch." exception "Symfony\Component\HttpKernel\Exception\HttpException" file "/var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php" line 396 I don't have a Cors problem, how can I send the token with the post call. I have noticed the following. After comparing the request csrf-cookie (both tokens) and the next request login compared the cookies in the request cookies are correct but in the response cookies the laravel_session are not the same.

So the problem is that laravel_session has lost the value of csrf-cookie (laravel_session) when calling the login page in response cookies. there is a different value in the laravel_session. Many thanks for a little help. Yours sincerely Dieter