403 -> 401 for incorrect password since 403 will be used for refresh tokens later
This commit is contained in:
1 parent
8f17cfbd8d
commit
ea4e19554b
1 file changed
+2
-2
@@ -279,10 +279,10 @@ const editUser = async (req, res, next) => {
|
||||
const user = await req.db.getUserByEmail(email);
|
||||
// Compare passwords
|
||||
const match = await user.comparePassword(req.body.password);
|
||||
// If not a match, throw a 403
|
||||
// If not a match, throw a 401
|
||||
if (!match) {
|
||||
const error = new Error(errorMessages.AUTH_INCORRECT_PASSWORD);
|
||||
error.status = 403;
|
||||
error.status = 401;
|
||||
next(error);
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user