From d1e047a3e73641d9a72337c9fee74cd76548159c Mon Sep 17 00:00:00 2001 From: Kelvin Samuel Date: Tue, 16 Nov 2021 22:07:23 +0700 Subject: [PATCH] add warning eror --- routes/registerlogin.js | 13 +++++-------- views/pages/login.ejs | 6 ++++++ 2 files changed, 11 insertions(+), 8 deletions(-) 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 %> + <% } %>
Or login with