Fix bugs from refactor!

This commit is contained in:
2020-11-11 20:58:18 -06:00
parent 7002e78aa0
commit 0193935d2d
11 changed files with 132 additions and 139 deletions

View File

@@ -7,7 +7,6 @@ const ExtractJWT = require(`passport-jwt`).ExtractJwt;
const { users } = require(`../models`);
module.exports = (passport) => {
const options = {};
options.jwtFromRequest = ExtractJWT.fromAuthHeaderAsBearerToken();
options.secretOrKey = process.env.tokenSecret;
@@ -24,6 +23,6 @@ module.exports = (passport) => {
if (!user) {
return done(null, false);
}
return done(null, user);
return done(null, users.convertToPublicFormat(user));
}));
};