Skip to content

Commit

Permalink
Add role to auth response
Browse files Browse the repository at this point in the history
  • Loading branch information
ebenezerdon committed Nov 10, 2018
1 parent 4bb821f commit 254ac09
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions server/routes/controllers/usersController.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,7 @@ const loginUser = (req, res) => {

return res.status(201).json({
token,
role: jwt.verify(token, secret, (error, decoded) => {
const { role } = decoded;
return role;
}),
role: jwt.verify(token, secret, (error, decoded) => decoded.role),
success: true,
});
}).catch(err => (res.status(500).json(err)));
Expand Down

0 comments on commit 254ac09

Please sign in to comment.