-
-
Notifications
You must be signed in to change notification settings - Fork 16
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
[Question] CORS Error on all requests #25
Comments
I think maybe this is some sort of CORS error due to Laravel Valet's SSL certificate. |
Hey @jjjrmy! However, I noticed that the server returns an additional header Nuxt application sends a proper set of headers (xsrf token, origin, referrer) as well as content type, but it would be useful to check the backend configuration, especially the list of the following things:
Based on these details, I assume that the backend part is misconfigured and we should focus on fixing it first. Also I would recommend setting up additional logs on the Laravel side to check what is going on when it receives a request from Nuxt. |
I'm going to close this issue because it entirely seems like an issue with my local environment and making requests to endpoints with Valet SSL certificates. |
@jjjrmy no problem, feel free to re-open it in case of issues related to the package! |
I setup Laravel Sanctum exactly like the docs say. If I copy the requests out of network tab in Chrome and put them in Postman, then the requests work fine.
Access to fetch at 'https://laravel.test/api/user' from origin 'https://spa.laravel.test' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
The text was updated successfully, but these errors were encountered: