Created
January 19, 2021 08:12
-
-
Save petrosDemetrakopoulos/dda294d985493da36cef3e9700c814d3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var csrf = require('csurf'); | |
var app = express(); | |
app.use(csrf()); | |
app.use(function(req, res, next) { | |
res.locals._csrf = req.csrfToken(); | |
next(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment