Comparing version 0.2.1 to 0.2.2
export declare type CancellablePromise<T> = Promise<T> & { | ||
cancel: () => void; | ||
cancel(): void; | ||
}; | ||
export declare type RegisterRequest = any; | ||
export declare type SignRequest = any; | ||
export declare type RegisterResponse = any; | ||
export declare type SignResponse = any; | ||
export declare type NotYetTyped = { [ key: string ]: any; }; | ||
export declare type RegisterRequest = NotYetTyped; | ||
export declare type SignRequest = NotYetTyped; | ||
export declare type RegisterResponse = NotYetTyped; | ||
export declare type SignResponse = NotYetTyped; | ||
export declare enum ErrorCodesEnum { | ||
@@ -33,3 +34,4 @@ CANCELLED = -1, | ||
} | ||
export declare type Exporter = ((promiseImplementation: PromiseConstructorLike) => API) & API; | ||
export default Exporter; | ||
export declare type ExporterType = ((promiseImplementation: PromiseConstructorLike) => API) & API; | ||
declare const _default: ExporterType; | ||
export default _default; |
@@ -7,2 +7,7 @@ 'use strict'; | ||
// Feature detection (yes really) | ||
var isSafari = navigator.userAgent.match( /Safari\// ) | ||
&& !navigator.userAgent.match( /Chrome\// ); | ||
var isEDGE = navigator.userAgent.match( /Edge\/12/ ); | ||
var _backend = null; | ||
@@ -14,9 +19,2 @@ function getBackend( Promise ) | ||
{ | ||
var hasNativeSupport = | ||
( typeof window.u2f !== 'undefined' ) && | ||
( typeof window.u2f.sign === 'function' ); | ||
if ( hasNativeSupport ) | ||
resolve( { u2f: window.u2f, native: true } ); | ||
function notSupported( ) | ||
@@ -28,10 +26,18 @@ { | ||
var isSafari = navigator.userAgent.match( /Safari\// ) | ||
&& !navigator.userAgent.match( /Chrome\// ); | ||
if ( isSafari ) | ||
// Safari doesn't support U2F, and the Safari-FIDO-U2F | ||
// extension lacks full support (Multi-factet apps), so we | ||
// block it until proper support. | ||
return notSupported( ); | ||
var isEDGE = navigator.userAgent.match( /Edge\/12/ ); | ||
var hasNativeSupport = | ||
( typeof window.u2f !== 'undefined' ) && | ||
( typeof window.u2f.sign === 'function' ); | ||
if ( isSafari || isEDGE ) | ||
// We don't want to check for Google's extension hack on these | ||
// platforms, as they will cause trouble (popups, etc) | ||
if ( hasNativeSupport ) | ||
resolve( { u2f: window.u2f, native: true } ); | ||
if ( isEDGE ) | ||
// We don't want to check for Google's extension hack on EDGE | ||
// as it'll cause trouble (popups, etc) | ||
return notSupported( ); | ||
@@ -38,0 +44,0 @@ |
@@ -5,3 +5,3 @@ { | ||
"license": "MIT", | ||
"version": "0.2.1", | ||
"version": "0.2.2", | ||
"author": "Gustaf Räntilä <g.rantila@gmail.com>", | ||
@@ -21,3 +21,4 @@ "repository": { | ||
"promise" | ||
] | ||
], | ||
"types": "./index.d.ts" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
24472
664