From 582853542aa22c8050641368f32effeaa2895c36 Mon Sep 17 00:00:00 2001 From: MathMan05 <73901602+MathMan05@users.noreply.github.com> Date: Sun, 25 Aug 2024 22:56:55 -0500 Subject: [PATCH 1/2] Check for old password when setting new Checks for password --- src/api/routes/users/@me/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api/routes/users/@me/index.ts b/src/api/routes/users/@me/index.ts index 9cd8bfda8..d4570b63e 100644 --- a/src/api/routes/users/@me/index.ts +++ b/src/api/routes/users/@me/index.ts @@ -127,7 +127,7 @@ router.patch( } if (body.new_password) { - if (!body.password && !user.email) { + if (!body.password || !user.email) { throw FieldErrors({ password: { code: "BASE_TYPE_REQUIRED", From 58603eefe46e0af0176ffaec8e54b66417c4c9c3 Mon Sep 17 00:00:00 2001 From: MathMan05 <73901602+MathMan05@users.noreply.github.com> Date: Sun, 25 Aug 2024 23:13:14 -0500 Subject: [PATCH 2/2] Fix the fix this should actually be what's intended --- src/api/routes/users/@me/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api/routes/users/@me/index.ts b/src/api/routes/users/@me/index.ts index d4570b63e..3ddce4b1f 100644 --- a/src/api/routes/users/@me/index.ts +++ b/src/api/routes/users/@me/index.ts @@ -127,7 +127,7 @@ router.patch( } if (body.new_password) { - if (!body.password || !user.email) { + if (!body.password && user.email) { throw FieldErrors({ password: { code: "BASE_TYPE_REQUIRED",