mirror of
https://github.com/spacebarchat/server.git
synced 2026-10-23 06:32:34 +00:00
Security: ensure that a bot user is infact a bot when requesting a token reset
This commit is contained in:
1 parent
f89ee5e24a
commit
1e99ed9e57
1 file changed
+1
-1
@@ -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