Delete password from user in login response

This commit is contained in:
rui hildt 2020-05-09 14:58:22 +02:00
parent aa3d51702f
commit dd6fa0e63c

View File

@ -30,9 +30,9 @@ router.post('/login', async (req, res) => {
if (bcrypt.compareSync(password, user.password)) {
const token = generateToken(user);
delete user.password;
res.status(200).json({
message: `Welcome ${user.username}!`,
user,
token,
});
} else {