add eslint, fix bugs found
This commit is contained in:
parent
fc2c3a7114
commit
12558d3384
28 changed files with 1774 additions and 745 deletions
|
@ -1,6 +1,6 @@
|
|||
const config = require('../config');
|
||||
const config = require('../config')
|
||||
module.exports = (req, res, next) => {
|
||||
res.locals.config = config;
|
||||
res.locals.req = req;
|
||||
next();
|
||||
};
|
||||
res.locals.config = config
|
||||
res.locals.req = req
|
||||
next()
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
const config = require('../config');
|
||||
const config = require('../config')
|
||||
module.exports = options => {
|
||||
return (req, res, next) => {
|
||||
options = options ? options : {};
|
||||
options = options || {}
|
||||
let authed = false
|
||||
try {
|
||||
authed = req.isAuthenticated()
|
||||
|
@ -10,5 +10,5 @@ module.exports = options => {
|
|||
}
|
||||
if (authed) return next()
|
||||
res.redirect(options.failureRedirect || config.defaultFailureRedirect)
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue