Skip to content

Instantly share code, notes, and snippets.

@MohiuddinAkib
Created August 26, 2019 09:05
Show Gist options
  • Save MohiuddinAkib/2b909497ffd6d563b04c81eb9151a875 to your computer and use it in GitHub Desktop.
Save MohiuddinAkib/2b909497ffd6d563b04c81eb9151a875 to your computer and use it in GitHub Desktop.
sending csrf token to spa with csurf library and express.js
app.all('*', function (req, res) {
res.cookie('XSRF-TOKEN', req.csrfToken())
res.render('index')
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment