From cfec14faa345cf1ffd782efcd5971659526ee59c Mon Sep 17 00:00:00 2001 From: Mihaly Lengyel Date: Sat, 28 Sep 2024 03:04:42 +0200 Subject: [PATCH] feat: error consistency improvements --- lib/build/recipe/oauth2provider/recipeImplementation.js | 6 ++++++ lib/ts/recipe/oauth2provider/recipeImplementation.ts | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/lib/build/recipe/oauth2provider/recipeImplementation.js b/lib/build/recipe/oauth2provider/recipeImplementation.js index 3d1f31061..f77e6ffc7 100644 --- a/lib/build/recipe/oauth2provider/recipeImplementation.js +++ b/lib/build/recipe/oauth2provider/recipeImplementation.js @@ -490,6 +490,12 @@ function getRecipeInterface( status: "OK", client: OAuth2Client_1.OAuth2Client.fromAPIResponse(response.body), }; + } else if (response.body.status === "CLIENT_NOT_FOUND_ERROR") { + return { + status: "ERROR", + error: "invalid_request", + errorDescription: "The provided client_id is not valid or unknown", + }; } else { return { status: "ERROR", diff --git a/lib/ts/recipe/oauth2provider/recipeImplementation.ts b/lib/ts/recipe/oauth2provider/recipeImplementation.ts index e37f1e732..3a0991e33 100644 --- a/lib/ts/recipe/oauth2provider/recipeImplementation.ts +++ b/lib/ts/recipe/oauth2provider/recipeImplementation.ts @@ -489,6 +489,12 @@ export default function getRecipeInterface( status: "OK", client: OAuth2Client.fromAPIResponse(response.body), }; + } else if (response.body.status === "CLIENT_NOT_FOUND_ERROR") { + return { + status: "ERROR", + error: "invalid_request", + errorDescription: "The provided client_id is not valid or unknown", + }; } else { return { status: "ERROR",