Skip to content

Commit

Permalink
error handling cleanup and general cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
niftyvictor committed Feb 13, 2025
1 parent 873df1e commit 1c350be
Show file tree
Hide file tree
Showing 9 changed files with 568 additions and 797 deletions.
7 changes: 4 additions & 3 deletions lib/build/recipe/webauthn/api/implementation.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ function getAPIImplementation() {
const supportedAlgorithmIds = constants_1.DEFAULT_REGISTER_OPTIONS_SUPPORTED_ALGORITHM_IDS;
let response = await options.recipeImplementation.registerOptions(
Object.assign(Object.assign({}, props), {
displayName: "displayName" in props ? props.displayName : undefined,
attestation,
residentKey,
userVerification,
Expand Down Expand Up @@ -304,7 +305,7 @@ function getAPIImplementation() {
userContext,
});
if (verifyResult.status !== "OK") {
return verifyResult;
return { status: "INVALID_CREDENTIALS_ERROR" };
}
const generatedOptions = await options.recipeImplementation.getGeneratedOptions({
webauthnGeneratedOptionsId,
Expand Down Expand Up @@ -855,8 +856,8 @@ function getAPIImplementation() {
});
if (
createUserResponse.status === "INVALID_CREDENTIALS_ERROR" ||
createUserResponse.status === "GENERATED_OPTIONS_NOT_FOUND_ERROR" ||
createUserResponse.status === "INVALID_GENERATED_OPTIONS_ERROR" ||
createUserResponse.status === "OPTIONS_NOT_FOUND_ERROR" ||
createUserResponse.status === "INVALID_OPTIONS_ERROR" ||
createUserResponse.status === "INVALID_AUTHENTICATOR_ERROR"
) {
return createUserResponse;
Expand Down
Loading

0 comments on commit 1c350be

Please sign in to comment.