Skip to content

Commit

Permalink
feat: error consistency improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
porcellus committed Sep 28, 2024
1 parent aee34f3 commit cfec14f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/build/recipe/oauth2provider/recipeImplementation.js
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
6 changes: 6 additions & 0 deletions lib/ts/recipe/oauth2provider/recipeImplementation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit cfec14f

Please sign in to comment.