update comments
This commit is contained in:
1 parent
df11a457f1
commit
a42e280e49
1 file changed
+2
-1
@@ -281,7 +281,8 @@ const editUser = async (req, res, next) => {
|
|||||||
const user = await req.db.getUserByEmail(email);
|
const user = await req.db.getUserByEmail(email);
|
||||||
// Compare passwords
|
// Compare passwords
|
||||||
const match = await user.comparePassword(req.body.password);
|
const match = await user.comparePassword(req.body.password);
|
||||||
// If not a match, throw a 401
|
// If not a match, throw a 403
|
||||||
|
// 403 instead of 401 to avoid triggering axios interceptor
|
||||||
if (!match) {
|
if (!match) {
|
||||||
const error = new Error(errorMessages.AUTH_INCORRECT_PASSWORD);
|
const error = new Error(errorMessages.AUTH_INCORRECT_PASSWORD);
|
||||||
error.status = 403;
|
error.status = 403;
|
||||||
|
|||||||
Reference in new issue
Block a user