Skip to content
Browse files

Add middleware.

  • Loading branch information...
1 parent ea1c9b8 commit caa1e4f464b8ba12276e3bf40514aaca367c2f44 @jharding committed with Sep 9, 2012
Showing with 8 additions and 0 deletions.
  1. +8 −0 index.js
View
8 index.js
@@ -0,0 +1,8 @@
+module.exports = function(name) {
+ name = name || 'token';
+
+ return function (req, res, next) {
+ res.locals[name] = req.session._csrf;
+ next();
+ };
+};

0 comments on commit caa1e4f

Please sign in to comment.
Something went wrong with that request. Please try again.