csrf.js 234 Bytes Raw Blame History Permalink 1 2 3 4 5 6 7 8 9 10 11 12 'use strict'; const csrf = require('csurf'); const csrfInit = csrf(); module.exports = (req, res, next) => { return csrfInit(req, res, (e) => { res.locals.csrfToken = req.csrfToken(); return next(e); }); };