Replace csurf with csrf-sync

This commit is contained in:
psibean
2023-01-29 20:31:21 +10:30
committed by Julian Lam
parent b00cd8be41
commit 5a994290f2
5 changed files with 22 additions and 5 deletions

15
src/middleware/csrf.js Normal file
View File

@@ -0,0 +1,15 @@
'use strict';
const { csrfSync } = require('csrf-sync');
const {
generateToken,
csrfSynchronisedProtection,
} = csrfSync({
size: 64
});
module.exports = {
generateToken,
csrfSynchronisedProtection,
};