mirror of
https://github.com/spacebarchat/server.git
synced 2026-04-14 00:45:40 +00:00
Ensure password was given if email is given in PATCH @me
This commit is contained in:
@@ -51,6 +51,8 @@ router.patch("/", route({ body: "UserModifySchema" }), async (req: Request, res:
|
||||
body.email = adjustEmail(body.email);
|
||||
if (!body.email)
|
||||
throw FieldErrors({ email: { message: req.t("auth:register.EMAIL_INVALID"), code: "EMAIL_INVALID" } });
|
||||
if (!body.password)
|
||||
throw FieldErrors({ password: { message: req.t("auth:register.INVALID_PASSWORD"), code: "INVALID_PASSWORD" } })
|
||||
}
|
||||
|
||||
if (body.new_password) {
|
||||
|
||||
Reference in New Issue
Block a user