Make userHandle optional

This commit is contained in:
Joao Peixoto
2019-01-26 22:26:40 -08:00
parent ca809fa16f
commit 5493a2aed1
2 changed files with 15 additions and 1 deletions
+2 -1
View File
@@ -1,6 +1,7 @@
// Type definitions for W3C (WebAppSec) Credential Management API Level 1, 0.3
// Project: https://github.com/w3c/webappsec-credential-management
// Definitions by: Iain McGinniss <https://github.com/iainmcgin>
// Joao Peixoto <https://github.com/Hartimer>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.7
@@ -493,7 +494,7 @@ interface AuthenticatorAttestationResponse extends AuthenticatorResponse {
interface AuthenticatorAssertionResponse extends AuthenticatorResponse {
readonly authenticatorData: ArrayBuffer;
readonly signature: ArrayBuffer;
readonly userHandle: ArrayBuffer;
readonly userHandle?: ArrayBuffer;
}
/**
@@ -352,3 +352,16 @@ function webauthnAuthenticate() {
console.log(e.message);
});
}
function mockAuthenticatorAssertionResponse() {
if (!navigator.credentials) {
return;
}
const sampleResponse: AuthenticatorAssertionResponse = {
clientDataJSON: new ArrayBuffer(0),
authenticatorData: new ArrayBuffer(0),
signature: new ArrayBuffer(0),
};
sampleResponse.userHandle === undefined;
}