Skip to content

Instantly share code, notes, and snippets.

@deepal
Last active October 14, 2019 20:58
Show Gist options
  • Save deepal/9b024bf51c52da0c873c to your computer and use it in GitHub Desktop.
Save deepal/9b024bf51c52da0c873c to your computer and use it in GitHub Desktop.
nodesec-csrf-express
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