Extend the pretense of non-existence of self-bans to API view route too
This commit is contained in:
		
							parent
							
								
									8b641d099a
								
							
						
					
					
						commit
						3e0f568ba4
					
				| @ -27,6 +27,8 @@ router.get("/", route({ permission: "BAN_MEMBERS" }), async (req: Request, res: | |||||||
| 	let bans = await Ban.find({ guild_id: guild_id }); | 	let bans = await Ban.find({ guild_id: guild_id }); | ||||||
| 
 | 
 | ||||||
| 	/* Filter secret from database registry.*/ | 	/* 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) => { | 	bans.forEach((registry: BanRegistrySchema) => { | ||||||
| 	delete registry.ip; | 	delete registry.ip; | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Erkin Alp Güney
						Erkin Alp Güney