Skip to content

Commit

Permalink
requested changes
Browse files Browse the repository at this point in the history
  • Loading branch information
bellaabdelouahab committed Jun 26, 2023
1 parent 41865dd commit dab86a2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions backend-app/controllers/auth_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,11 +187,11 @@ exports.updatePassword = async (req, res, next) => {
const user = await User.findOne({ email }).select("+password");

if (!resetKey) {
return next(new AppError(404, "fail", "Please provide reset key"));
return next(new AppError(400, "fail", "Please provide reset key"));
}

if (resetKey !== user.resetKey) {
return next(new AppError(404, "fail", "Invalid reset key"));
return next(new AppError(400, "fail", "Invalid reset key"));
}

user.password = password;
Expand All @@ -217,7 +217,7 @@ exports.forgotPassword = async (req, res, next) => {
const { email } = req.body;

if (!email) {
return next(new AppError(404, "fail", "Please provide email"));
return next(new AppError(400, "fail", "Please provide email"));
}

const user = await User.findOne({ email });
Expand Down

0 comments on commit dab86a2

Please sign in to comment.