diff options
Diffstat (limited to 'src/api/routes/users/@me/delete.ts')
-rw-r--r-- | src/api/routes/users/@me/delete.ts | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/src/api/routes/users/@me/delete.ts b/src/api/routes/users/@me/delete.ts index e36a1e92..a8e043f6 100644 --- a/src/api/routes/users/@me/delete.ts +++ b/src/api/routes/users/@me/delete.ts @@ -46,10 +46,7 @@ router.post( if (user.data.hash) { // guest accounts can delete accounts without password - correctpass = await bcrypt.compare( - req.body.password, - user.data.hash, - ); + correctpass = await bcrypt.compare(req.body.password, user.data.hash); if (!correctpass) { throw new HTTPError(req.t("auth:login.INVALID_PASSWORD")); } @@ -58,16 +55,13 @@ router.post( // TODO: decrement guild member count if (correctpass) { - await Promise.all([ - User.delete({ id: req.user_id }), - Member.delete({ id: req.user_id }), - ]); + await Promise.all([User.delete({ id: req.user_id }), Member.delete({ id: req.user_id })]); res.sendStatus(204); } else { res.sendStatus(401); } - }, + } ); export default router; |