From 9cba85c47cfde1decbee513e48f82deff27a438d Mon Sep 17 00:00:00 2001 From: Pitu Date: Thu, 28 Feb 2019 23:52:04 +0900 Subject: changes --- src/api/routes/auth/loginPOST.js | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/api') diff --git a/src/api/routes/auth/loginPOST.js b/src/api/routes/auth/loginPOST.js index 38bbc49..205737a 100644 --- a/src/api/routes/auth/loginPOST.js +++ b/src/api/routes/auth/loginPOST.js @@ -19,6 +19,11 @@ class loginPOST extends Route { const user = await db.table('users').where('username', username).first(); if (!user) return res.status(401).json({ message: 'Invalid authorization' }); + /* + Checks if the user is disabled + */ + if (!user.enabled) return res.status(401).json({ message: 'This account has been disabled' }); + /* Checks if the password is right */ -- cgit v1.2.3