diff options
| author | Pitu <[email protected]> | 2019-02-28 23:52:04 +0900 |
|---|---|---|
| committer | Pitu <[email protected]> | 2019-02-28 23:52:04 +0900 |
| commit | 9cba85c47cfde1decbee513e48f82deff27a438d (patch) | |
| tree | 4324bee0ef8b8f43949502763849ea29e38fcb6e /src/api/routes/auth/loginPOST.js | |
| parent | Purge user's files (diff) | |
| download | host.fuwn.me-9cba85c47cfde1decbee513e48f82deff27a438d.tar.xz host.fuwn.me-9cba85c47cfde1decbee513e48f82deff27a438d.zip | |
changes
Diffstat (limited to 'src/api/routes/auth/loginPOST.js')
| -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); |