1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-16 00:03:56 +00:00

PM-21553: Added support for credential.toJSON() (#15028)

* Added support for credential.toJSON()

* Changed to import type
This commit is contained in:
Anders Åberg
2025-06-18 11:31:00 +02:00
committed by GitHub
parent 58b53f7338
commit b2b695a705
2 changed files with 41 additions and 0 deletions

View File

@@ -88,6 +88,7 @@ export class WebauthnUtils {
getClientExtensionResults: () => ({
credProps: result.extensions.credProps,
}),
toJSON: () => Fido2Utils.createResultToJson(result),
} as PublicKeyCredential;
// Modify prototype chains to fix `instanceof` calls.
@@ -134,6 +135,7 @@ export class WebauthnUtils {
} as AuthenticatorAssertionResponse,
getClientExtensionResults: () => ({}),
authenticatorAttachment: "platform",
toJSON: () => Fido2Utils.getResultToJson(result),
} as PublicKeyCredential;
// Modify prototype chains to fix `instanceof` calls.