diff options
Diffstat (limited to 'src/api/routes')
| -rw-r--r-- | src/api/routes/auth/loginPOST.js | 5 |
1 files changed, 5 insertions, 0 deletions
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 @@ -20,6 +20,11 @@ class loginPOST extends Route { 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 */ const comparePassword = await bcrypt.compare(password, user.password); |