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

authentication-adal-pkg

Package Overview
Dependencies
Maintainers
1
Versions
51
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

authentication-adal-pkg - npm Package Compare versions

Comparing version 1.0.18 to 1.0.19

22

lib/index.js

@@ -301,4 +301,8 @@ 'use strict';

};
var authenticateMobile = function authenticateMobile(resolve, reject) {
var storeToken = function(token, exp) {
storage.set(constants.IN_PROGRESS, false);
storage.set(constants.TOKEN, token);
storage.set(constants.TOKEN_EXPIRATION, exp);
};
var authenticateMobile = function(resolve, reject) {
// Check if MS ADAL cordova library is installed

@@ -321,5 +325,3 @@ Microsoft.ADAL.AuthenticationSettings.setUseBroker(true).then(function() {

var exp = new Date(authResult.expiresOn).getTime();
storage.set(constants.IN_PROGRESS, false);
storage.set(constants.TOKEN, token);
storage.set(constants.TOKEN_EXPIRATION, exp);
storeToken(token, exp);
resolve(authResult);

@@ -329,3 +331,11 @@ },

// We require user credentials so triggers authentication dialog
acquireTokenAsyncMobile(resolve, reject);
// acquireTokenAsyncMobile(resolve, reject);
authContext
.acquireTokenAsync(resourceUri, clientId, platformRedirectUri)
.then(function(authResult) {
var token = authResult.idToken;
var exp = new Date(authResult.expiresOn).getTime();
storeToken(token, exp);
resolve(authResult);
}, reject);
}

@@ -332,0 +342,0 @@ );

@@ -288,3 +288,3 @@ 'use strict';

var acquireTokenAsyncMobile = function(rosolve, reject) {
var acquireTokenAsyncMobile = function(resolve, reject) {
authContext

@@ -328,4 +328,3 @@ .acquireTokenAsync(resourceUri, clientId, platformRedirectUri)

} else {
// When token has expired, acquire new token
acquireTokenAsyncMobile(resolve, reject);
acquireTokenAsyncMobile(rosolve, reject);
}

@@ -335,3 +334,13 @@ },

// We require user credentials so triggers authentication dialog
acquireTokenAsyncMobile(resolve, reject);
authContext
.acquireTokenAsync(resourceUri, clientId, platformRedirectUri)
.then(function(authResult) {
var idToken = authResult.idToken;
var _decodeTokenPayload3 = decodeTokenPayload(idToken);
var exp = _decodeTokenPayload3.exp;
storage.set(constants.IN_PROGRESS, false);
storage.set(constants.TOKEN, idToken);
storage.set(constants.TOKEN_EXPIRATION, exp);
resolve(authResult);
}, reject);
}

@@ -338,0 +347,0 @@ );

{
"name": "authentication-adal-pkg",
"version": "1.0.18",
"version": "1.0.19",
"description": "An authentication SDK based on MS ADAL ",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

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