summary refs log tree commit diff
path: root/src/api/routes
diff options
context:
space:
mode:
authorPuyodead1 <puyodead@proton.me>2023-12-09 13:39:40 -0500
committerPuyodead1 <puyodead@proton.me>2023-12-09 13:39:40 -0500
commit9d266f1dbaa76043d56a9514d7c36c7073d15cbb (patch)
treecdf5e5cddaff4451941bd910fc349b07b0629006 /src/api/routes
parentensure client_id is provided in authorize (diff)
downloadserver-9d266f1dbaa76043d56a9514d7c36c7073d15cbb.tar.xz
ensure client_id is specified in authorize post
Diffstat (limited to '')
-rw-r--r--src/api/routes/oauth2/authorize.ts10
1 files changed, 10 insertions, 0 deletions
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