File tree 2 files changed +15
-0
lines changed
2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change 7
7
export {
8
8
create ,
9
9
get ,
10
+ supported ,
10
11
} from "./webauthn" ;
11
12
export {
12
13
schema ,
Original file line number Diff line number Diff line change @@ -14,3 +14,17 @@ export async function get(requestJSON: CredentialRequestOptionsJSON): Promise<Pu
14
14
const response = ( await navigator . credentials . get ( request ) ) as PublicKeyCredential ;
15
15
return convert ( bufferToBase64url , publicKeyCredentialWithAssertion , response ) ;
16
16
}
17
+
18
+ declare global {
19
+ interface Window {
20
+ PublicKeyCredential : any | undefined ;
21
+ }
22
+ }
23
+
24
+ // This function does a simple check to test for the credential management API
25
+ // functions we need, and an indication of public credential authentication
26
+ // support.
27
+ // https://developers.google.com/web/updates/2018/03/webauthn-credential-management
28
+ export function supported ( ) : boolean {
29
+ return ! ! ( navigator . credentials && navigator . credentials . create && navigator . credentials . get && window . PublicKeyCredential ) ;
30
+ }
You can’t perform that action at this time.
0 commit comments