Fix bugs from refactor!
This commit is contained in:
@@ -27,7 +27,7 @@ const register = async (req, res, next) => {
|
||||
return next(error, null);
|
||||
}
|
||||
|
||||
const token = jwt.sign(user, process.env.tokenSecret, {
|
||||
const token = jwt.sign(users.convertToPublicFormat(user), process.env.tokenSecret, {
|
||||
expiresIn: 604800 // 1 week
|
||||
});
|
||||
|
||||
@@ -61,7 +61,7 @@ const login = async (req, res, next) => {
|
||||
return res.status(401).send({ error: `Authentication failed. Wrong password.` });
|
||||
}
|
||||
|
||||
const token = jwt.sign(user, process.env.tokenSecret, {
|
||||
const token = jwt.sign(users.convertToPublicFormat(user), process.env.tokenSecret, {
|
||||
expiresIn: 604800 // 1 week
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user