![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
jquery-csrf-token
Advanced tools
Add a X-CSRF-TOKEN and X-CSRFToken header to each AJAX request.
This package adds a csrf header to AJAX requests done via jQuery.
In the following situations no header is set:
GET
, HEAD
, OPTIONS
, or TRACE
.Laravel uses the X-CSRF-TOKEN
header to check for a CSRF token. Django uses X-CSRFToken
. This package defaults to X-CSRF-TOKEN
for the header key, but you can change this using the config settings.
It's only dependency is on jQuery.
Installation:
$ npm install jquery-csrf-token --save
var csrfToken = require('jquery-csrf-token');
csrfToken.enable('my-beautiful-csrf-token', config);
csrfToken.setToken('updated-csrf-token');
Name | Default | Description |
---|---|---|
key | X-CSRF-TOKEN | The key under which the csrf token should be send. Use X-CSRFTOKEN for Django. |
retry | false | Allow to get a new token if the current one is expired |
To be able to get a new token if the current one expired you need to pass a retry object for the config with two keys:
url
: URL to request the new tokenparseResponse
: A function that takes the token request response as a parameter and return the new tokenisCSRFFailure
(optional): A function that takes the failed request response as a parameter and return true if it's a CSRF failure. By default it just retry on every 403.Example:
csrfToken.enable(data.csrf_token, {
key: 'X-CSRFTOKEN',
retry: {
url: 'api/bootstrap/',
parseResponse: resp => resp.csrf_token,
isCSRFFailure: resp => resp.statusCode === 403 && resp.responseJSON.message === 'CSRFFailure',
},
});
FAQs
Add a X-CSRF-TOKEN and X-CSRFToken header to each AJAX request.
The npm package jquery-csrf-token receives a total of 40 weekly downloads. As such, jquery-csrf-token popularity was classified as not popular.
We found that jquery-csrf-token demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.