summary refs log tree commit diff
diff options
context:
space:
mode:
authorMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2022-07-07 23:30:47 +1000
committerMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2022-07-07 23:30:47 +1000
commit9e12ccee69b537a2833bf94ebaa7ffa8f413f8e3 (patch)
treea5a04f017d1db0d3aeb77356d200c4a37721e2a5
parentMerge branch 'master' into fix/claim_accounts (diff)
downloadserver-9e12ccee69b537a2833bf94ebaa7ffa8f413f8e3.tar.xz
Ensure password was given if email is given in PATCH @me
-rw-r--r--api/src/routes/users/@me/index.ts2
1 files changed, 2 insertions, 0 deletions
diff --git a/api/src/routes/users/@me/index.ts b/api/src/routes/users/@me/index.ts
index 122080f2..b42a00b2 100644
--- a/api/src/routes/users/@me/index.ts
+++ b/api/src/routes/users/@me/index.ts
@@ -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) {