summaryrefslogtreecommitdiffhomepage
path: root/packages/typescript-types
diff options
context:
space:
mode:
authorMatthew Miller <matthew@millerti.me>2020-05-25 23:25:57 -0700
committerMatthew Miller <matthew@millerti.me>2020-05-25 23:25:57 -0700
commit4566757cfc71683040f455c37039ed7371ad7ff1 (patch)
tree698b2309492cf1ecfbc1cb9c66eeb9848da32723 /packages/typescript-types
parentd0205b9a4f2b4e304447e8072e4384f52dcc0c51 (diff)
Add new credential descriptor JSON type
Diffstat (limited to 'packages/typescript-types')
-rw-r--r--packages/typescript-types/src/index.ts15
1 files changed, 8 insertions, 7 deletions
diff --git a/packages/typescript-types/src/index.ts b/packages/typescript-types/src/index.ts
index cab623c..3e52a5d 100644
--- a/packages/typescript-types/src/index.ts
+++ b/packages/typescript-types/src/index.ts
@@ -42,14 +42,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 +51,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()
*/