Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

u2f-api

Package Overview
Dependencies
Maintainers
1
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

u2f-api - npm Package Compare versions

Comparing version 0.2.2 to 0.2.3

84

lib/u2f-api.js

@@ -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": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc