From a30196605b582d7ea2cd3309c293dcaa740b29cc Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Sun, 11 Oct 2020 14:43:46 +0200 Subject: Fixed unhandled promise rejection (ig) --- auth/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'auth') diff --git a/auth/index.js b/auth/index.js index 3ef330d..45b26f3 100644 --- a/auth/index.js +++ b/auth/index.js @@ -10,7 +10,7 @@ function checkUser(req, res, next) { } function checkAdmin(req, res, next) { - if (!req.session.loggedIn) res.redirect("/auth"); + if (!req.session.loggedIn) return res.redirect("/auth"); try { db.query("SELECT is_admin FROM users WHERE id = ?", [req.session.uid]).then((ret) => { -- cgit v1.2.3