Open
Description
In Authorization: User Roles and Permissions chapter, we need to add role: req.body.role,
to signup
function, otherwise, the user role will always be default "user" and never updated to req.body.role
exports.signup = catchAsyncError(async (req, res, next) => {
const newUser = await User.create({
name: req.body.name,
email: req.body.email,
password: req.body.password,
passwordConfirm: req.body.passwordConfirm,
role: req.body.role,
});
....
}
Metadata
Metadata
Assignees
Labels
No labels