Update csrf-sync to fallback to _csrf query param

isekai-main
psibean 2 years ago committed by Julian Lam
parent bb0397cbc8
commit f553da48e1

@ -6,6 +6,13 @@ const {
generateToken,
csrfSynchronisedProtection,
} = 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,
});

Loading…
Cancel
Save