You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi!
I have a problem and I don't know why it happens.
In local everything works fine, but in production I have mydomain.com (frontend) and api.mydomain.com (backend). When I try to login I get 419 ("message": "CSRF token mismatch.").
Do you know why?
Thanks and good job! :)
The text was updated successfully, but these errors were encountered:
Have you checked the configuration section on Sanctum docs?
You are likely missing this:
Finally, you should ensure your application's session cookie domain configuration supports any subdomain of your root domain. You may accomplish this by prefixing the domain with a leading . within your application's config/session.php configuration file: 'domain' => '.domain.com'
Make sure to include that dot prefix!
So in your case it should be:
'domain' => '.mydomain.com'
You can also do this through an environment variable:
Hi!
I have a problem and I don't know why it happens.
In local everything works fine, but in production I have mydomain.com (frontend) and api.mydomain.com (backend). When I try to login I get 419 ("message": "CSRF token mismatch.").
Do you know why?
Thanks and good job! :)
The text was updated successfully, but these errors were encountered: