Add role to account

This commit is contained in:
Ben Elferink
2021-09-29 10:53:39 +03:00
parent 5c3c54b4a9
commit 8de38c6536
3 changed files with 8 additions and 2 deletions

View File

@@ -44,7 +44,7 @@ async function register(request, response, next) {
delete newAccount.password
// Generate access token
const token = signToken({uid: newAccount._id})
const token = signToken({uid: newAccount._id, role: newAccount.role})
response.status(201).json({
message: 'Succesfully registered',