Code refactoring
This commit is contained in:
4
app.js
4
app.js
@ -89,8 +89,8 @@ app.use(passport.initialize());
|
|||||||
app.use(passport.session());
|
app.use(passport.session());
|
||||||
app.use(function(req, res, next) {
|
app.use(function(req, res, next) {
|
||||||
// Conditional CSRF.
|
// Conditional CSRF.
|
||||||
if (_.contains(csrfWhitelist, req.path)) next();
|
if (_.contains(csrfWhitelist, req.path)) return next();
|
||||||
else csrf(req, res, next);
|
csrf(req, res, next);
|
||||||
});
|
});
|
||||||
app.use(function(req, res, next) {
|
app.use(function(req, res, next) {
|
||||||
res.locals.user = req.user;
|
res.locals.user = req.user;
|
||||||
|
Reference in New Issue
Block a user