diff --git a/server/src/controller/user.controller.ts b/server/src/controller/user.controller.ts index b5982fe..68b6515 100644 --- a/server/src/controller/user.controller.ts +++ b/server/src/controller/user.controller.ts @@ -15,7 +15,9 @@ router.post(apiNamespace, (req, res) => { password, }) .then(() => { - res.json(); + res.json({ + success: true, + }); }) .catch((err) => { res.status(422).json({ @@ -29,6 +31,13 @@ router.post(`${apiNamespace}/sign_in`, async (req, res) => { const user = await UserService.findByEmail(email); + if (!user) { + res.status(500).json({ + error: "Invalid credentails", + }); + return; + } + const isPasswordValid = await AuthService.isUserPasswordValid(user, password); if (isPasswordValid) {