mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-06 07:47:04 +00:00
Make userHandle optional
This commit is contained in:
+2
-1
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user