mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-01 11:35:55 +01:00
Update csrf-sync to fallback to _csrf query param
This commit is contained in:
@@ -6,6 +6,13 @@ const {
|
|||||||
generateToken,
|
generateToken,
|
||||||
csrfSynchronisedProtection,
|
csrfSynchronisedProtection,
|
||||||
} = csrfSync({
|
} = csrfSync({
|
||||||
|
getTokenFromRequest: (req) => {
|
||||||
|
if (req.headers['x-csrf-token']) {
|
||||||
|
return req.headers['x-csrf-token'];
|
||||||
|
} else if (req.query) {
|
||||||
|
return req.query._csrf;
|
||||||
|
}
|
||||||
|
},
|
||||||
size: 64,
|
size: 64,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user