Skip to content

Commit

Permalink
Merge pull request #24 from kentibs/fix/token-mail-validate
Browse files Browse the repository at this point in the history
fix: right error message for forgot-password endpoint
  • Loading branch information
Tibz-Dankan authored Jan 3, 2024
2 parents 7dcdc42 + be75c87 commit d863a91
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/controllers/userController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,7 @@ export const forgotPassword = asyncHandler(
});

if (!user) {
return next(
new AppError("There is no user with supplied phone number", 404)
);
return next(new AppError("There is no user with provided email", 404));
}

const resetToken = randomBytes(32).toString("hex");
Expand Down

0 comments on commit d863a91

Please sign in to comment.