diff options
Diffstat (limited to 'packages/typescript-types/src')
-rw-r--r-- | packages/typescript-types/src/index.ts | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/packages/typescript-types/src/index.ts b/packages/typescript-types/src/index.ts index cab623c..353623e 100644 --- a/packages/typescript-types/src/index.ts +++ b/packages/typescript-types/src/index.ts @@ -28,6 +28,7 @@ export type PublicKeyCredentialCreationOptionsJSON = { ]; timeout?: number; attestation: 'direct' | 'indirect'; + excludeCredentials: PublicKeyCredentialDescriptorJSON[]; }; }; @@ -42,14 +43,8 @@ export type PublicKeyCredentialCreationOptionsJSON = { */ export type PublicKeyCredentialRequestOptionsJSON = { publicKey: { - // challenge: string; - allowCredentials: { - // Will be converted to a Uint8Array in the browser - id: string; - type: 'public-key'; - transports?: AuthenticatorTransport[]; - }[]; + allowCredentials: PublicKeyCredentialDescriptorJSON[]; // extensions?: AuthenticationExtensionsClientInputs, rpId?: string; timeout?: number; @@ -57,6 +52,13 @@ export type PublicKeyCredentialRequestOptionsJSON = { }; }; +export interface PublicKeyCredentialDescriptorJSON extends Omit< +PublicKeyCredentialDescriptor, 'id' +> { + // Should be a Base64-encoded credential ID. Will be converted to a Uint8Array in the browser + id: string; +} + /** * The value returned from navigator.credentials.create() */ |