From a2d5056b8ff4430c13d4e5f4dbca76eea3554ef2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Akif=20Y=C3=BCce?= <70021050+Akif9748@users.noreply.github.com> Date: Thu, 31 Mar 2022 01:01:32 +0300 Subject: [PATCH] Update admin.js --- routes/admin.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/routes/admin.js b/routes/admin.js index b2d5e61..6bf133f 100644 --- a/routes/admin.js +++ b/routes/admin.js @@ -9,7 +9,7 @@ app.get("/", (req, res) => { if (!req.session.loggedin) return res.redirect('/login'); const user = new User().getId(req.session.userid) - if (!user.admin) return error(res, 404, "You have not got permissions for view to this page."); + if (!user.admin) return error(res, 403, "You have not got permissions for view to this page."); res.render("admin", { user, user2: false }) } @@ -20,7 +20,7 @@ app.post("/", (req, res) => { const user = new User().getId(req.session.userid) - if (!user.admin) return error(res, 404, "You have not got permissions for view to this page."); + if (!user.admin) return error(res, 403, "You have not got permissions for view to this page."); const user2 = new User().getId(req.body.userid) if (!user2) @@ -36,4 +36,4 @@ app.post("/", (req, res) => { }); -module.exports = app; \ No newline at end of file +module.exports = app;