mirror of
https://github.com/spacebarchat/server.git
synced 2026-09-01 22:18:46 +00:00
Security: ensure that a bot user is infact a bot when requesting a token reset
This commit is contained in:
@@ -66,7 +66,7 @@ router.post(
|
||||
},
|
||||
}),
|
||||
async (req: Request, res: Response) => {
|
||||
const bot = await User.findOneOrFail({ where: { id: req.params.application_id as string } });
|
||||
const bot = await User.findOneOrFail({ where: { id: req.params.application_id as string, bot: true } });
|
||||
const owner = req.user;
|
||||
|
||||
if (owner.id != req.user_id) throw DiscordApiErrors.ACTION_NOT_AUTHORIZED_ON_APPLICATION;
|
||||
|
||||
Reference in New Issue
Block a user