From 9d266f1dbaa76043d56a9514d7c36c7073d15cbb Mon Sep 17 00:00:00 2001 From: Puyodead1 Date: Sat, 9 Dec 2023 13:39:40 -0500 Subject: ensure client_id is specified in authorize post --- src/api/routes/oauth2/authorize.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src') diff --git a/src/api/routes/oauth2/authorize.ts b/src/api/routes/oauth2/authorize.ts index f7cec207..2f2351f3 100644 --- a/src/api/routes/oauth2/authorize.ts +++ b/src/api/routes/oauth2/authorize.ts @@ -197,6 +197,16 @@ router.post( // const { client_id, scope, response_type, redirect_url } = req.query; const { client_id } = req.query; + if (!client_id) { + throw FieldErrors({ + client_id: { + code: "BASE_TYPE_REQUIRED", + message: req.t("common:field.BASE_TYPE_REQUIRED"), + }, + }); + } + + // TODO: ensure guild_id is not an empty string // TODO: captcha verification // TODO: MFA verification -- cgit 1.5.1