Comments (6)
Depends, I think your API is usually stateless and/or protected with authentication, not just a session.
But if you do want to use it, you should get the token by calling the API and use that token in post requests.
from laravel-cors.
Did you disable csrf protection?
from laravel-cors.
I may be understanding CSRF protection then, wouldn't I want to keep it for everything or is it unnecessary for an API?
from laravel-cors.
So do a GET request to the API for the token, have the server return it, store it on the client, send that as a header for all future requests?
from laravel-cors.
I guess, but if you use an API token we something, you wouldn't need it I think.
from laravel-cors.
Ok. I'll disable CSRF then. Thanks for the response. Closing.
from laravel-cors.
Related Issues (20)
- [Solution] Add exception handler cross domain for laravel 8.x HOT 2
- Multiple CORS header ‘Access-Control-Allow-Origin’ not allowed HOT 1
- Laravel 8 Error Cors HOT 2
- Cannot set the same Access-Control-Allow-Headers values in apache setting? HOT 1
- 500 Error Class "Fruitcake\Cors\CorsServiceProvider" not found HOT 2
- Cors not working with POST request with Docker and Nginx HOT 3
- Specify domain for paths HOT 2
- CORS configuration per route HOT 1
- Middleware API POST request with CORS issue (Passport and Auth0) HOT 1
- how to return or expose these Access-Control-Allow-Methods and Access-Control-Allow-Headers ?
- Laravel cors are not returned HOT 3
- Add laravel9 support HOT 4
- v2.1.0 it's a breaking change HOT 7
- Composer error upon installing in Laravel 7
- How to add add Access-Control-Allow-Origin to error 500 response
- PHP 8.1 Passing null to parameter #1 ($haystack) of type string is deprecated
- How to block Cors on a same subdomain
- strpos(): Argument #1 ($haystack) must be of type string, array given on \vendor\fruitcake\laravel-cors HOT 2
- Access-Control-Allow-Origin is missing laravel-9 and vuejs3
- Composer error upon installing in Laravel 9 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from laravel-cors.