From d9a228ce8898e9bc7170b2465f771751ca79edd3 Mon Sep 17 00:00:00 2001 From: tungd0 Date: Thu, 11 May 2023 18:31:24 +0000 Subject: [PATCH] Update 'src/api/middlewares/authen.middleware.js' --- src/api/middlewares/authen.middleware.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/api/middlewares/authen.middleware.js b/src/api/middlewares/authen.middleware.js index 3226dfe..ea748f4 100644 --- a/src/api/middlewares/authen.middleware.js +++ b/src/api/middlewares/authen.middleware.js @@ -35,7 +35,7 @@ exports.loadUser = async (req, res, next) => { try { const user = await User.getUserByPhoneOrEmail({ email: req.body.email || req.body.username }); if (!user) { - return res.status(400).json({ message: 'email incorrect' }); + return res.status(400).json({ message: 'email or password is incorrect' }); } req.locals = { user @@ -51,7 +51,7 @@ exports.checkPassword = async (req, res, next) => { // console.log(user); const isCheck = await User.passwordMatches(user, req.body.password); if (!isCheck) { - return res.status(400).json({ message: ' password incorrect' }); + return res.status(400).json({ message: 'email or password is incorrect' }); } return next(); };