Comparing version 0.2.2 to 0.2.3
@@ -199,32 +199,34 @@ 'use strict'; | ||
{ | ||
if ( native ) | ||
function cbNative( response ) | ||
{ | ||
function cb( response ) | ||
if ( response.errorCode ) | ||
reject( makeError( "Registration failed", response ) ); | ||
else | ||
{ | ||
if ( response.errorCode ) | ||
reject( makeError( "Registration failed", response ) ); | ||
else | ||
{ | ||
delete response.errorCode; | ||
resolve( response ); | ||
} | ||
delete response.errorCode; | ||
resolve( response ); | ||
} | ||
} | ||
function cbChrome( err, response ) | ||
{ | ||
if ( err ) | ||
reject( err ); | ||
else if ( response.errorCode ) | ||
reject( makeError( "Registration failed", response ) ); | ||
else | ||
resolve( response ); | ||
} | ||
if ( native ) | ||
{ | ||
var appId = registerRequests[ 0 ].appId; | ||
u2f.register( | ||
appId, registerRequests, signRequests, cb, timeout ); | ||
appId, registerRequests, signRequests, cbNative, timeout ); | ||
} | ||
else | ||
{ | ||
function cb( err, response ) | ||
{ | ||
if ( err ) | ||
reject( err ); | ||
else if ( response.errorCode ) | ||
reject( makeError( "Registration failed", response ) ); | ||
else | ||
resolve( response ); | ||
} | ||
u2f.register( registerRequests, signRequests, cb, timeout ); | ||
u2f.register( | ||
registerRequests, signRequests, cbChrome, timeout ); | ||
} | ||
@@ -252,33 +254,33 @@ } ); | ||
{ | ||
if ( native ) | ||
function cbNative( response ) | ||
{ | ||
function cb( response ) | ||
if ( response.errorCode ) | ||
reject( makeError( "Sign failed", response ) ); | ||
else | ||
{ | ||
if ( response.errorCode ) | ||
reject( makeError( "Sign failed", response ) ); | ||
else | ||
{ | ||
delete response.errorCode; | ||
resolve( response ); | ||
} | ||
delete response.errorCode; | ||
resolve( response ); | ||
} | ||
} | ||
function cbChrome( err, response ) | ||
{ | ||
if ( err ) | ||
reject( err ); | ||
else if ( response.errorCode ) | ||
reject( makeError( "Sign failed", response ) ); | ||
else | ||
resolve( response ); | ||
} | ||
if ( native ) | ||
{ | ||
var appId = signRequests[ 0 ].appId; | ||
var challenge = signRequests[ 0 ].challenge; | ||
u2f.sign( appId, challenge, signRequests, cb, timeout ); | ||
u2f.sign( appId, challenge, signRequests, cbNative, timeout ); | ||
} | ||
else | ||
{ | ||
function cb( err, response ) | ||
{ | ||
if ( err ) | ||
reject( err ); | ||
else if ( response.errorCode ) | ||
reject( makeError( "Sign failed", response ) ); | ||
else | ||
resolve( response ); | ||
} | ||
u2f.sign( signRequests, cb, timeout ); | ||
u2f.sign( signRequests, cbChrome, timeout ); | ||
} | ||
@@ -285,0 +287,0 @@ } ); |
@@ -5,3 +5,3 @@ { | ||
"license": "MIT", | ||
"version": "0.2.2", | ||
"version": "0.2.3", | ||
"author": "Gustaf Räntilä <g.rantila@gmail.com>", | ||
@@ -8,0 +8,0 @@ "repository": { |
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
24488
665