From d778bd9a3a5368e35650619fd9941aae211af5aa Mon Sep 17 00:00:00 2001 From: pm3512 Date: Tue, 12 Mar 2024 18:14:55 -0400 Subject: [PATCH] removed changes to reg login --- src/controllers/AuthController.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/controllers/AuthController.ts b/src/controllers/AuthController.ts index 2d443a3..984ee75 100644 --- a/src/controllers/AuthController.ts +++ b/src/controllers/AuthController.ts @@ -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();