mirror of
https://github.com/spacebarchat/server.git
synced 2026-10-22 17:32:30 +00:00
Extend the pretense of non-existence of self-bans to API view route too
This commit is contained in:
1 parent
f9c371f01f
commit
3dd20d86f1
1 file changed
+2
@@ -27,6 +27,8 @@ router.get("/", route({ permission: "BAN_MEMBERS" }), async (req: Request, res:
|
||||
let bans = await Ban.find({ guild_id: guild_id });
|
||||
|
||||
/* Filter secret from database registry.*/
|
||||
if (banned_user.user_id === banned_user.executor_id) throw DiscordApiErrors.UNKNOWN_BAN;
|
||||
// hide self-bans from view to prevent victim chasing
|
||||
|
||||
bans.forEach((registry: BanRegistrySchema) => {
|
||||
delete registry.ip;
|
||||
|
||||
Reference in new issue
Block a user