Skip to content

Commit

Permalink
removed changes to reg login
Browse files Browse the repository at this point in the history
  • Loading branch information
pm3512 committed Mar 12, 2024
1 parent f241bd9 commit d778bd9
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/controllers/AuthController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,11 @@ const loginWithInfo = async (
} else {
try {
const user = await User.findOne({ email });
const incorrectString = "Incorrect email or password";
if (!user) {
return unauthorized(res, incorrectString);
return notFound(res, "Unknown account");
} else {
if (!user.checkPassword(password)) {
return unauthorized(res, incorrectString);
return bad(res, "Incorrect password");
} else {
// Return json of user without password hash
const token = user.generateAuthToken();
Expand Down

0 comments on commit d778bd9

Please sign in to comment.