diff --git a/src/controllers/logincontroller.js b/src/controllers/logincontroller.js index 3ba0203aa..794d00d70 100644 --- a/src/controllers/logincontroller.js +++ b/src/controllers/logincontroller.js @@ -63,7 +63,7 @@ const logincontroller = function () { res.status(200).send({ token }); } else { - res.status(403).send({ + res.status(404).send({ message: 'Invalid password.', }); } diff --git a/src/controllers/logincontroller.spec.js b/src/controllers/logincontroller.spec.js index 595bfe77b..995be69de 100644 --- a/src/controllers/logincontroller.spec.js +++ b/src/controllers/logincontroller.spec.js @@ -110,7 +110,7 @@ describe('logincontroller module', () => { expect(findOneSpy).toHaveBeenCalledWith({ email: mockReqModified.body.email }); assertResMock( - 403, + 404, { message: 'Invalid password.', }, diff --git a/src/controllers/userProfileController.js b/src/controllers/userProfileController.js index 2f0a64965..dde3036f7 100644 --- a/src/controllers/userProfileController.js +++ b/src/controllers/userProfileController.js @@ -724,14 +724,14 @@ const userProfileController = function (UserProfile, Project) { }) .catch((error) => { if (error.name === 'ValidationError' && error.errors.lastName) { - const errors = Object.values(error.errors).map(er => er.message); + const errors = Object.values(error.errors).map((er) => er.message); return res.status(400).json({ message: 'Validation Error', error: errors, }); } - console.error('Failed to save record:', error); - return res.status(400).json({ error: 'Failed to save record.' }); + console.error('Failed to save record:', error); + return res.status(400).json({ error: 'Failed to save record.' }); }); }); };