Skip to content

Commit

Permalink
fix(core): fix webauthn verificaiton api
Browse files Browse the repository at this point in the history
fix webauthn verification api
  • Loading branch information
simeng-li committed Aug 7, 2024
1 parent 956428b commit c72ae0e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export class WebAuthnVerification implements MfaVerificationRecord<VerificationT
readonly userId;
private verified;
private registrationChallenge?: string;
private readonly authenticationChallenge?: string;
private authenticationChallenge?: string;

Check warning on line 74 in packages/core/src/routes/experience/classes/verifications/web-authn-verification.ts

View check run for this annotation

Codecov / codecov/patch

packages/core/src/routes/experience/classes/verifications/web-authn-verification.ts#L74

Added line #L74 was not covered by tests
#registrationInfo?: BindWebAuthn;

constructor(
Expand Down Expand Up @@ -201,6 +201,8 @@ export class WebAuthnVerification implements MfaVerificationRecord<VerificationT
rpId: hostname,
});

this.authenticationChallenge = authenticationOptions.challenge;

Check warning on line 205 in packages/core/src/routes/experience/classes/verifications/web-authn-verification.ts

View check run for this annotation

Codecov / codecov/patch

packages/core/src/routes/experience/classes/verifications/web-authn-verification.ts#L204-L205

Added lines #L204 - L205 were not covered by tests
return authenticationOptions;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {
bindWebAuthnPayloadGuard,
VerificationType,
webAuthnAuthenticationOptionsGuard,
webAuthnRegistrationOptionsGuard,
webAuthnVerificationPayloadGuard,
} from '@logto/schemas';
Expand Down Expand Up @@ -128,7 +129,7 @@ export default function webAuthnVerificationRoute<T extends ExperienceInteractio
koaGuard({
response: z.object({
verificationId: z.string(),
authenticationOptions: webAuthnRegistrationOptionsGuard,
authenticationOptions: webAuthnAuthenticationOptionsGuard,
}),
status: [200, 400, 404],
}),
Expand Down

0 comments on commit c72ae0e

Please sign in to comment.