replaced eslint:recommended with prettier

This commit is contained in:
Wyatt Johnson
2018-01-11 20:00:34 -07:00
parent d56c19016a
commit 0abc2ca243
649 changed files with 16235 additions and 13008 deletions
+22 -18
View File
@@ -1,25 +1,29 @@
const {passport} = require('../services/passport');
const { passport } = require('../services/passport');
const debug = require('debug')('talk:middleware:authentication');
const authentication = (req, res, next) => passport.authenticate('jwt', {
session: false
}, (err, user) => {
if (err) {
debug(`cannot get the user: ${err}`);
return next(err);
}
const authentication = (req, res, next) =>
passport.authenticate(
'jwt',
{
session: false,
},
(err, user) => {
if (err) {
debug(`cannot get the user: ${err}`);
return next(err);
}
if (user) {
if (user) {
debug('user was on request');
debug('user was on request');
// Attach the user to the request object, now that we know it exists.
req.user = user;
} else {
debug('user was not on request');
}
// Attach the user to the request object, now that we know it exists.
req.user = user;
} else {
debug('user was not on request');
}
next();
})(req, res, next);
next();
}
)(req, res, next);
module.exports = authentication;