diff --git a/routes/registerlogin.js b/routes/registerlogin.js index 778e808..ef6e2dc 100644 --- a/routes/registerlogin.js +++ b/routes/registerlogin.js @@ -150,20 +150,17 @@ exports.login = async function (req, res) { code: 204, success: "Sorry You havent verified your email", }); - } else { + } else { res.render("pages/index"); } } else { - res.send({ - code: 204, - success: "Sorry Email and password does not match", + res.render('pages/login', { + companyName : 'SALAH', + error : 'Wrong Username or Password' }); } } else { - res.send({ - code: 204, - success: "Sorry Email does not exits", - }); + res.render("pages/login-error"); } } } diff --git a/views/pages/login.ejs b/views/pages/login.ejs index 08b7267..3eb2b62 100644 --- a/views/pages/login.ejs +++ b/views/pages/login.ejs @@ -44,6 +44,12 @@ password? + <% if(locals.error) { %> + <%= error %> + <% } %> + <% if(locals.regisverify) { %> + <%= error %> + <% } %>