Last active
October 14, 2019 20:58
-
-
Save deepal/9b024bf51c52da0c873c to your computer and use it in GitHub Desktop.
nodesec-csrf-express
This file contains 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'); | |
/*some code here*/ | |
var app = express(); | |
/*some code here*/ | |
app.use(csrf()); | |
app.get('/', function(req, res, next){ | |
res.render('index', { | |
_csrfToken = req.csrfToken(); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment