diff options
| author | Pitu <[email protected]> | 2019-03-12 05:48:01 +0000 |
|---|---|---|
| committer | Pitu <[email protected]> | 2019-03-12 05:48:01 +0000 |
| commit | 197e69f2f2194df4ad23bb913c9efd39e1501b96 (patch) | |
| tree | 336f3b45d9626c9b05700bbdcefb0d18168f270a /src/api/routes/admin/userEnable.js | |
| parent | No more infinite loading if album is empty (diff) | |
| download | host.fuwn.me-197e69f2f2194df4ad23bb913c9efd39e1501b96.tar.xz host.fuwn.me-197e69f2f2194df4ad23bb913c9efd39e1501b96.zip | |
Prevent snowflakes from demoting/disabling themselves
Diffstat (limited to 'src/api/routes/admin/userEnable.js')
| -rw-r--r-- | src/api/routes/admin/userEnable.js | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/api/routes/admin/userEnable.js b/src/api/routes/admin/userEnable.js index 7e5743d..bdba7a6 100644 --- a/src/api/routes/admin/userEnable.js +++ b/src/api/routes/admin/userEnable.js @@ -9,6 +9,7 @@ class userEnable extends Route { if (!req.body) return res.status(400).json({ message: 'No body provided' }); const { id } = req.body; if (!id) return res.status(400).json({ message: 'No id provided' }); + if (id === user.id) return res.status(400).json({ message: 'You can\'t apply this action to yourself' }); try { await db.table('users') |