summary refs log tree commit diff
path: root/src/api
diff options
context:
space:
mode:
authorTomatoCake <60300461+DEVTomatoCake@users.noreply.github.com>2024-07-28 21:45:20 +0200
committerGitHub <noreply@github.com>2024-07-28 21:45:20 +0200
commitbc3a3add2d48f20e234d6138ae566cfa73feb393 (patch)
tree8f265c97ad74fddb58c441b034244b2a25bd672b /src/api
parentFix ?before messages fetch param (diff)
parentMerge pull request #1153 from aintDatCap/master (diff)
downloadserver-ts-bc3a3add2d48f20e234d6138ae566cfa73feb393.tar.xz
Merge branch 'master' into fix/messages-before-param
Diffstat (limited to 'src/api')
-rw-r--r--src/api/routes/guilds/#guild_id/bulk-ban.ts4
-rw-r--r--src/api/routes/users/@me/index.ts11
2 files changed, 13 insertions, 2 deletions
diff --git a/src/api/routes/guilds/#guild_id/bulk-ban.ts b/src/api/routes/guilds/#guild_id/bulk-ban.ts

index f544103a..e5f7a0d8 100644 --- a/src/api/routes/guilds/#guild_id/bulk-ban.ts +++ b/src/api/routes/guilds/#guild_id/bulk-ban.ts
@@ -27,6 +27,7 @@ import { } from "@spacebar/util"; import { Request, Response, Router } from "express"; import { HTTPError } from "lambert-server"; +import { Config } from "@spacebar/util"; const router: Router = Router(); @@ -52,7 +53,8 @@ router.post( const userIds: Array<string> = req.body.user_ids; if (!userIds) throw new HTTPError("The user_ids array is missing", 400); - if (userIds.length > 200) + + if (userIds.length > Config.get().limits.guild.maxBulkBanUsers) throw new HTTPError( "The user_ids array must be between 1 and 200 in length", 400, diff --git a/src/api/routes/users/@me/index.ts b/src/api/routes/users/@me/index.ts
index ad11a428..cddc3a08 100644 --- a/src/api/routes/users/@me/index.ts +++ b/src/api/routes/users/@me/index.ts
@@ -120,7 +120,7 @@ router.patch( if (!body.password) throw FieldErrors({ password: { - message: req.t("auth:register.INVALID_PASSWORD"), + message: req.t("auth:login.INVALID_PASSWORD"), code: "INVALID_PASSWORD", }, }); @@ -160,6 +160,15 @@ router.patch( }, }); } + + if (!body.password) { + throw FieldErrors({ + password: { + message: req.t("auth:login.INVALID_PASSWORD"), + code: "INVALID_PASSWORD", + }, + }); + } } if (body.discriminator) {