mirror of
https://github.com/spacebarchat/server.git
synced 2026-08-04 19:19:49 +00:00
Merge branch 'master' into fix/messages-before-param
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user