1
0
mirror of https://github.com/spacebarchat/server.git synced 2024-09-20 09:41:35 +02:00

Revert "Don't let users undisable their accounts"

This reverts commit cd84412c92.
This commit is contained in:
Madeline 2023-01-01 14:20:41 +11:00
parent cd84412c92
commit 1bee8dc48f

View File

@ -66,6 +66,9 @@ router.post(
}); });
if (undelete) { if (undelete) {
// undelete refers to un'disable' here
if (user.disabled)
await User.update({ id: user.id }, { disabled: false });
if (user.deleted) if (user.deleted)
await User.update({ id: user.id }, { deleted: false }); await User.update({ id: user.id }, { deleted: false });
} else { } else {
@ -74,13 +77,12 @@ router.post(
message: "This account is scheduled for deletion.", message: "This account is scheduled for deletion.",
code: 20011, code: 20011,
}); });
}
if (user.disabled) if (user.disabled)
return res.status(400).json({ return res.status(400).json({
message: req.t("auth:login.ACCOUNT_DISABLED"), message: req.t("auth:login.ACCOUNT_DISABLED"),
code: 20013, code: 20013,
}); });
}
// the salt is saved in the password refer to bcrypt docs // the salt is saved in the password refer to bcrypt docs
const same_password = await bcrypt.compare( const same_password = await bcrypt.compare(