New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@blackbaud/auth-client

Package Overview
Dependencies
Maintainers
1
Versions
120
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@blackbaud/auth-client - npm Package Compare versions

Comparing version 2.1.0 to 2.2.0

31

bundles/auth-client.umd.js

@@ -609,2 +609,3 @@ (function webpackUniversalModuleDefinition(root, factory) {

var currentAllowAnonymous;
var currentLegacyKeepAliveUrl;
var legacyTtl;

@@ -684,3 +685,5 @@ var legacySigninUrl;

BBOmnibarUserActivity.startTracking = function (refreshUserCallback, showInactivityCallback, hideInactivityCallback, allowAnonymous, legacyKeepAliveUrl) {
if (!isTracking || allowAnonymous !== currentAllowAnonymous) {
if (!isTracking ||
allowAnonymous !== currentAllowAnonymous ||
legacyKeepAliveUrl !== currentLegacyKeepAliveUrl) {
BBOmnibarUserActivity.stopTracking();

@@ -691,2 +694,3 @@ currentRefreshUserCallback = refreshUserCallback;

currentAllowAnonymous = allowAnonymous;
currentLegacyKeepAliveUrl = legacyKeepAliveUrl;
addActivityListeners();

@@ -726,3 +730,4 @@ startActivityTimer();

currentAllowAnonymous =
undefined;
currentLegacyKeepAliveUrl =
undefined;
};

@@ -925,3 +930,5 @@ return BBOmnibarUserActivity;

BBOmnibarUserSessionWatcher.start = function (allowAnonymous, legacyKeepAliveUrl, refreshUserCallback, stateChange) {
if (!isWatching || allowAnonymous !== currentAllowAnonymous) {
if (!isWatching ||
allowAnonymous !== currentAllowAnonymous ||
legacyKeepAliveUrl !== currentLegacyKeepAliveUrl) {
BBOmnibarUserSessionWatcher.stop();

@@ -981,2 +988,3 @@ currentAllowAnonymous = allowAnonymous;

var omnibarConfig;
var currentLegacyKeepAliveUrl;
var promiseResolve;

@@ -1065,6 +1073,6 @@ function addElToBodyTop(el) {

}
function handleGetToken(tokenRequestId, disableRedirect, legacyKeepAliveUrl) {
function startActivityTracking() {
omnibar_user_activity_1.BBOmnibarUserActivity.startTracking(refreshUserCallback, showInactivityCallback, hideInactivityCallback, omnibarConfig.allowAnonymous, legacyKeepAliveUrl);
}
function startActivityTracking() {
omnibar_user_activity_1.BBOmnibarUserActivity.startTracking(refreshUserCallback, showInactivityCallback, hideInactivityCallback, omnibarConfig.allowAnonymous, currentLegacyKeepAliveUrl);
}
function handleGetToken(tokenRequestId, disableRedirect) {
auth_1.BBAuth.getToken({

@@ -1196,3 +1204,3 @@ disableRedirect: disableRedirect

case 'get-token':
handleGetToken(message.tokenRequestId, message.disableRedirect, omnibarConfig.legacyKeepAliveUrl);
handleGetToken(message.tokenRequestId, message.disableRedirect);
break;

@@ -1211,2 +1219,6 @@ case 'help-open':

break;
case 'legacy-keep-alive-url-change':
currentLegacyKeepAliveUrl = message.url;
startActivityTracking();
break;
}

@@ -1225,2 +1237,5 @@ }

omnibarConfig = omnibarConfig = config;
// TODO: Deprecate this and only allow it to come from the legacy-keep-alive-url-change message
// from the omnibar.
currentLegacyKeepAliveUrl = omnibarConfig.legacyKeepAliveUrl;
return new Promise(function (resolve) {

@@ -1227,0 +1242,0 @@ promiseResolve = resolve;

@@ -1,1 +0,1 @@

(function e(n,t){if(typeof exports==="object"&&typeof module==="object")module.exports=t();else if(typeof define==="function"&&define.amd)define([],t);else if(typeof exports==="object")exports["BBAuthClient"]=t();else n["BBAuthClient"]=t()})(this,function(){return function(e){var n={};function t(r){if(n[r]){return n[r].exports}var i=n[r]={i:r,l:false,exports:{}};e[r].call(i.exports,i,i.exports,t);i.l=true;return i.exports}t.m=e;t.c=n;t.i=function(e){return e};t.d=function(e,n,r){if(!t.o(e,n)){Object.defineProperty(e,n,{configurable:false,enumerable:true,get:r})}};t.n=function(e){var n=e&&e.__esModule?function n(){return e["default"]}:function n(){return e};t.d(n,"a",n);return n};t.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)};t.p="";return t(t.s=5)}([function(e,n,t){"use strict";function r(e){for(var t in e)if(!n.hasOwnProperty(t))n[t]=e[t]}Object.defineProperty(n,"__esModule",{value:true});r(t(8));r(t(6))},function(e,n,t){"use strict";Object.defineProperty(n,"__esModule",{value:true});var r=t(0);var i="https://signin.blackbaud.com/signin/";var o="https://host.nxt.blackbaud.com/errors/";var a=encodeURIComponent;function s(e){var n=[];for(var t in e){if(e.hasOwnProperty(t)){n.push(a(t)+"="+a(e[t]))}}return n.join("&")}function c(e){var n=i+"?redirectUrl="+a(location.href);if(e){n+="&inactivity=1"}return n}var u=function(){function e(){}e.navigate=function(e,n){if(n){location.replace(e)}else{location.href=e}};e.redirectToSignin=function(e){var n=c();if(e){n+="&"+s(e)}this.navigate(n)};e.redirectToSignoutForInactivity=function(){var e=c(true);var n=i+"sign-out?redirectUrl="+a(e);this.navigate(n)};e.redirectToError=function(e){var n;var t;switch(e){case r.BBAuthTokenErrorCode.InvalidEnvironment:t="invalid_env";n="security";break;default:n="broken";break}var i=""+o+n+"?source=auth-client&url="+a(location.href);if(t){i+="&code="+a(t)}this.navigate(i)};return e}();n.BBAuthNavigator=u},function(e,n,t){"use strict";Object.defineProperty(n,"__esModule",{value:true});var r="https://s21aidntoken00blkbapp01.nxt.blackbaud.com/session/csrf";var i=t(0);var o=t(1);function a(e,n,t,r,o){var a=new XMLHttpRequest;a.onreadystatechange=function(){if(a.readyState===4){switch(a.status){case 200:r(a.responseText);break;case 401:o({code:i.BBAuthTokenErrorCode.NotLoggedIn,message:"The user is not logged in."});break;case 403:o({code:i.BBAuthTokenErrorCode.InvalidEnvironment,message:"The user is not a member of the specified environment."});break;default:if(a.status===0||a.status>=400){o({code:i.BBAuthTokenErrorCode.Unspecified,message:"An unknown error occurred."})}break}}};a.open("POST",e,true);a.setRequestHeader(n.name,n.value);a.setRequestHeader("Accept","application/json");a.setRequestHeader("Content-Type","application/json");a.withCredentials=true;if(t){a.send(JSON.stringify(t))}else{a.send()}}function s(e,n,t,r){var i;if(t){i={environment_id:t};if(r){i.permission_scope=r}}return new Promise(function(t,r){a(e,{name:"X-CSRF",value:n},i,function(e){var n=e?JSON.parse(e):undefined;t(n)},r)})}var c=function(){function e(){}e.request=function(e,n,t,a,c){if(c&&!a){return Promise.reject({code:i.BBAuthTokenErrorCode.PermissionScopeNoEnvironment,message:"You must also specify an environment when specifying a permission scope."})}return new Promise(function(u,f){s(r,"token_needed").then(function(n){return s(e,n["csrf_token"],a,c)}).then(u).catch(function(e){if(t){f(e)}else{switch(e.code){case i.BBAuthTokenErrorCode.NotLoggedIn:o.BBAuthNavigator.redirectToSignin(n);break;default:o.BBAuthNavigator.redirectToError(e.code);break}}})})};return e}();n.BBCsrfXhr=c},function(e,n,t){"use strict";Object.defineProperty(n,"__esModule",{value:true});var r="https://host.nxt.blackbaud.com";var i=function(){function e(){}e.postOmnibarMessage=function(e,n,t){n.source="auth-client";e.contentWindow.postMessage(n,t||r)};e.messageIsFromOmnibar=function(e){if(e.origin===r){var n=e.data;return!!n&&n.source==="skyux-spa-omnibar"}return false};return e}();n.BBAuthInterop=i},function(e,n,t){"use strict";function r(e){for(var t in e)if(!n.hasOwnProperty(t))n[t]=e[t]}Object.defineProperty(n,"__esModule",{value:true});r(t(15));r(t(9))},function(e,n,t){"use strict";function r(e){for(var t in e)if(!n.hasOwnProperty(t))n[t]=e[t]}Object.defineProperty(n,"__esModule",{value:true});r(t(0));r(t(4))},function(e,n,t){"use strict";Object.defineProperty(n,"__esModule",{value:true});var r;(function(e){e[e["Unspecified"]=0]="Unspecified";e[e["NotLoggedIn"]=1]="NotLoggedIn";e[e["InvalidEnvironment"]=2]="InvalidEnvironment";e[e["PermissionScopeNoEnvironment"]=3]="PermissionScopeNoEnvironment"})(r=n.BBAuthTokenErrorCode||(n.BBAuthTokenErrorCode={}))},function(e,n,t){"use strict";Object.defineProperty(n,"__esModule",{value:true});var r=t(2);var i=function(){function e(){}e.getToken=function(e,n,t){return r.BBCsrfXhr.request("https://s21aidntoken00blkbapp01.nxt.blackbaud.com/oauth2/token",undefined,e,n,t)};return e}();n.BBAuthTokenIntegration=i},function(e,n,t){"use strict";Object.defineProperty(n,"__esModule",{value:true});var r=t(7);function i(e){var n=e.envId,t=e.permissionScope;return"token|"+(n||"-")+"|"+(t||"-")}var o=function(){function e(){}e.getToken=function(n){return e.getTokenInternal(n)};e.clearTokenCache=function(){e.tokenCache={}};e.getTokenInternal=function(n){n=n||{};var t=n.forceNewToken,o=n.disableRedirect;if(e.mock){return Promise.resolve("mock_access_token_auth-client@blackbaud.com")}var a=i(n);var s=e.tokenCache[a]=e.tokenCache[a]||{};var c=(new Date).valueOf();if(!t&&s.lastToken&&s.expirationTime&&s.expirationTime-c>60*1e3){return Promise.resolve(s.lastToken)}if(!s.pendingLookupPromise){s.pendingLookupPromise=r.BBAuthTokenIntegration.getToken(o,n.envId,n.permissionScope).then(function(e){s.expirationTime=(new Date).valueOf()+e["expires_in"]*1e3;s.lastToken=e["access_token"];s.pendingLookupPromise=null;return s.lastToken}).catch(function(e){s.pendingLookupPromise=null;throw e})}return s.pendingLookupPromise};return e}();o.mock=false;o.tokenCache={};n.BBAuth=o},function(e,n,t){"use strict";Object.defineProperty(n,"__esModule",{value:true});var r=t(10);function i(){return window.jQuery}var o=function(){function e(){}e.load=function(e){return new Promise(function(n){var t=i();var o=t&&t.fn&&t.fn.jquery;r.BBOmnibarScriptLoader.smartRegisterScript("https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.0/jquery.js","2.1.0",o).then(function(){return r.BBOmnibarScriptLoader.registerScript("https://cdnjs.cloudflare.com/ajax/libs/easyXDM/2.4.17.1/easyXDM.min.js")}).then(function(){return r.BBOmnibarScriptLoader.registerScript("https://signin.blackbaud.com/Omnibar.min.js")}).then(function(){document.body.classList.add("bb-omnibar-height-padding");var t=document.createElement("div");t.setAttribute("data-omnibar-el","");document.body.appendChild(t);e=e||{};e["z-index"]=1e3;e.afterLoad=n;if(e.menuEl){e.menuEl=i()(e.menuEl)}BBAUTH.Omnibar.load(t,e)})})};return e}();n.BBOmnibarLegacy=o},function(e,n,t){"use strict";Object.defineProperty(n,"__esModule",{value:true});function r(e){var n=e.split(".");var t=[];for(var r=0,i=n;r<i.length;r++){var o=i[r];var a=parseInt(o,10)||0;t.push(a)}return t}function i(e,n){var t=r(e);var i=r(n);for(var o=0;o<t.length;o++){if(o<i.length){if(i[o]>t[o]){return true}else if(i[o]<t[o]){return false}}}return true}var o=function(){function e(){}e.registerScript=function(e){return new Promise(function(n,t){var r=document.createElement("script");r.onload=n;r.onerror=t;r.src=e;document.body.appendChild(r)})};e.smartRegisterScript=function(n,t,r){if(r&&i(t,r)){return Promise.resolve()}return e.registerScript(n)};return e}();n.BBOmnibarScriptLoader=o},function(e,n,t){"use strict";Object.defineProperty(n,"__esModule",{value:true});var r=function(){function e(){}e.process=function(e){var n=e.allowAnonymous,t=e.closeInactivityPrompt,r=e.expirationDate,i=e.inactivityPromptDuration,o=e.isShowingInactivityPrompt,a=e.lastActivity,s=e.maxSessionAge,c=e.minRenewalAge,u=e.redirectForInactivity,f=e.renewSession,d=e.showInactivityPrompt;var l=Date.now();if(r===null){return}if(!n&&l>r){u()}var v=r-i;var p=r-s+c;if(o){if(l<v){t()}}else{if(a>p){f()}else if(!n&&l>v){d()}}};return e}();n.BBOmnibarUserActivityProcessor=r},function(e,n,t){"use strict";Object.defineProperty(n,"__esModule",{value:true});var r=t(11);var i=t(13);var o=t(14);var a=t(2);var s=t(1);var c;var u;var f;var d;var l;var v;var p;var m;var h;var b;var g="";var y;var k;var B;function I(){m=Date.now()}function T(e){if(e.clientX!==u||e.clientY!==f){u=e.clientX;f=e.clientY;I()}}function E(){var e=Date.now();if(!h||e-h>N.MIN_RENEWAL_RETRY){h=e;a.BBCsrfXhr.request("https://s21aidntoken00blkbapp01.nxt.blackbaud.com/session/renew",{inactivity:1}).catch(function(){return undefined})}}function _(){document.addEventListener("keypress",I);document.addEventListener("mousemove",T)}function A(){p=true;v()}function O(){p=false;I();d()}function w(){if(B){s.BBAuthNavigator.navigate(B)}else{s.BBAuthNavigator.redirectToSignoutForInactivity()}}function S(){if(!y){E()}b=setInterval(function(){i.BBOmnibarUserSessionExpiration.getSessionExpiration(g,k,y).then(function(e){r.BBOmnibarUserActivityProcessor.process({allowAnonymous:y,closeInactivityPrompt:O,expirationDate:e,inactivityPromptDuration:N.INACTIVITY_PROMPT_DURATION,isShowingInactivityPrompt:p,lastActivity:m,maxSessionAge:N.MAX_SESSION_AGE,minRenewalAge:N.MIN_RENEWAL_AGE,redirectForInactivity:w,renewSession:E,showInactivityPrompt:A})})},N.ACTIVITY_TIMER_INTERVAL)}var N=function(){function e(){}e.startTracking=function(n,t,r,i,a){if(!c||i!==y){e.stopTracking();l=n;v=t;d=r;y=i;_();S();o.BBOmnibarUserSessionWatcher.start(i,a,l,function(e){k=e.legacyTtl;g=e.refreshId;B=e.legacySigninUrl});c=true}};e.userRenewedSession=function(){O();E()};e.stopTracking=function(){o.BBOmnibarUserSessionWatcher.stop();i.BBOmnibarUserSessionExpiration.reset();document.removeEventListener("keypress",I);document.removeEventListener("mousemove",T);if(b){clearInterval(b);b=undefined}c=u=f=m=h=p=l=v=d=y=undefined};return e}();N.ACTIVITY_TIMER_INTERVAL=1e3;N.MIN_RENEWAL_RETRY=1*60*1e3;N.INACTIVITY_PROMPT_DURATION=2*60*1e3;N.MIN_RENEWAL_AGE=5*60*1e3;N.MAX_SESSION_AGE=15*60*1e3;N.IDENTITY_SECURITY_TOKEN_SERVICE_ORIGIN="https://s21aidntoken00blkbapp01.nxt.blackbaud.com";n.BBOmnibarUserActivity=N},function(e,n,t){"use strict";Object.defineProperty(n,"__esModule",{value:true});var r=t(2);var i;function o(e,n){if(i&&i.refreshId===e&&i.allowAnonymous===n){return i.promise}var t=new Promise(function(e,t){r.BBCsrfXhr.request("https://s21aidntoken00blkbapp01.nxt.blackbaud.com/session/ttl",undefined,n).then(function(n){var t=n===null?null:Date.now()+n*1e3;e(t)},function(){e(null)})});i={allowAnonymous:n,promise:t,refreshId:e};return t}var a=function(){function e(){}e.getSessionExpiration=function(e,n,t){var r=o(e,t);return new Promise(function(e,t){r.then(function(t){var r;if(t===null){r=null}else if(typeof n==="number"){var i=Date.now()+n;r=Math.min(t,i)}else{r=t}e(r)})})};e.reset=function(){i=undefined};return e}();n.BBOmnibarUserSessionExpiration=a},function(e,n,t){"use strict";Object.defineProperty(n,"__esModule",{value:true});var r=t(3);var i=t(1);var o;var a;var s;var c;var u;var f;var d;var l={};var v;function p(e){if(e){var n=e.split("://");var t=n[0];var r=n[1].split("/")[0];return t+"://"+r}return undefined}function m(e){if(d){r.BBAuthInterop.postOmnibarMessage(d,e,p(a))}}function h(e,n){var t=document.createElement("iframe");t.className=e;t.width="0";t.height="0";t.frameBorder="0";t.src=n;t.tabIndex=-1;document.body.appendChild(t);return t}function b(){var e=I.IDENTITY_SECURITY_TOKEN_SERVICE_ORIGIN+"/SessionWatcher.html?origin="+encodeURIComponent(location.origin);f=h("sky-omnibar-iframe-session-watcher",e)}function g(){if(a){d=h("sky-omnibar-iframe-legacy-keep-alive",a)}}function y(e){if(typeof e.data==="string"){var n=void 0;try{n=JSON.parse(e.data)}catch(e){return}if(n.messageType==="session_change"){var t=n.message;var r=t&&t.sessionId;var o=t&&t.refreshId;if(!r&&!u){if(v){i.BBAuthNavigator.navigate(v)}else{i.BBAuthNavigator.redirectToSignin()}}if(l.refreshId!==undefined&&o!==l.refreshId){m({messageType:"session-refresh"})}if(l.sessionId!==undefined&&r!==l.sessionId){s()}l.refreshId=o;l.sessionId=r;c(l)}}}function k(e){var n=e.data;switch(n.messageType){case"ready":l.legacyTtl=n.ttl;v=n.signinUrl;c(l);break}}function B(e){switch(e.origin){case I.IDENTITY_SECURITY_TOKEN_SERVICE_ORIGIN:y(e);break;case p(a):k(e);break}}var I=function(){function e(){}e.start=function(n,t,r,i){if(!o||n!==u){e.stop();u=n;s=r;a=t;c=i;b();g();window.addEventListener("message",B,false);o=true}};e.stop=function(){window.removeEventListener("message",B,false);if(f){document.body.removeChild(f);f=undefined}if(d){document.body.removeChild(d);d=undefined}l={};o=u=s=a=v=c=undefined};return e}();I.IDENTITY_SECURITY_TOKEN_SERVICE_ORIGIN="https://s21aidntoken00blkbapp01.nxt.blackbaud.com";n.BBOmnibarUserSessionWatcher=I},function(e,n,t){"use strict";Object.defineProperty(n,"__esModule",{value:true});var r=t(0);var i=t(3);var o=t(12);var a=t(1);var s="sky-omnibar-iframe-expanded";var c="sky-omnibar-loading";var u;var f;var d;var l;var v;var p;function m(e){var n=document.body;if(n.firstChild){n.insertBefore(e,n.firstChild)}else{n.appendChild(e)}}function h(){l=document.createElement("iframe");l.className="sky-omnibar-iframe "+c;l.src=R();m(l)}function b(){u=document.createElement("div");u.className="sky-omnibar-environment";m(u)}function g(){l.classList.remove(s)}function y(){var e='\nbody {\n margin-top: 50px;\n}\n\n#bb-help-container {\n padding-top: 1px;\n}\n\n.sky-omnibar-iframe,\n.sky-omnibar-placeholder {\n border: none;\n height: 50px;\n width: 100%;\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n z-index: 1000;\n}\n\n.sky-omnibar-placeholder {\n background-color: #4d5259;\n border-top: 5px solid #00b4f1;\n display: none;\n}\n\n.sky-omnibar-placeholder.sky-omnibar-loading {\n display: block;\n}\n\n.sky-omnibar-iframe.sky-omnibar-loading {\n visibility: hidden;\n}\n\n.sky-omnibar-iframe-expanded {\n height: 100%;\n}\n\n.sky-omnibar-environment {\n background-color: #e1e1e3;\n color: #282b31;\n font-family: "Blackbaud Sans", "Open Sans", "Helvetica Neue", Arial, sans-serif;\n font-size: 12px;\n font-weight: 400;\n height: 0;\n line-height: 24px;\n overflow: hidden;\n padding: 0 15px;\n text-align: right;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.sky-omnibar-environment-visible .sky-omnibar-environment {\n height: 24px;\n}\n ';d=document.createElement("style");d.appendChild(document.createTextNode(e));document.head.appendChild(d)}function k(){f=document.createElement("div");f.className="sky-omnibar-placeholder "+c;document.body.appendChild(f)}function B(){l.classList.add(s)}function I(){i.BBAuthInterop.postOmnibarMessage(l,{href:document.location.href,messageType:"location-change"})}function T(e){if(v.onSearch){v.onSearch(e).then(function(e){i.BBAuthInterop.postOmnibarMessage(l,{messageType:"search-results",results:e})})}}function E(){function e(e){i.BBAuthInterop.postOmnibarMessage(l,{messageType:"refresh-user",token:e})}r.BBAuth.clearTokenCache();r.BBAuth.getToken({disableRedirect:true,forceNewToken:true}).then(e).catch(function(){return e(undefined)})}function _(){i.BBAuthInterop.postOmnibarMessage(l,{messageType:"inactivity-show"})}function A(){i.BBAuthInterop.postOmnibarMessage(l,{messageType:"inactivity-hide"})}function O(e,n,t){function a(){o.BBOmnibarUserActivity.startTracking(E,_,A,v.allowAnonymous,t)}r.BBAuth.getToken({disableRedirect:n}).then(function(n){a();i.BBAuthInterop.postOmnibarMessage(l,{messageType:"token",token:n,tokenRequestId:e})},function(n){a();i.BBAuthInterop.postOmnibarMessage(l,{messageType:"token-fail",reason:n,tokenRequestId:e})})}function w(){var e=window.BBHELP;if(e){e.HelpWidget.open()}}function S(e){var n=v.notifications;if(n&&n.onNotificationRead){n.onNotificationRead(e)}}function N(e){var n="sky-omnibar-environment-visible";var t=document.body.classList;e=e||"";u.innerText=e;if(e){t.add(n)}else{t.remove(n)}}function P(){var e=history.pushState;var n=history.replaceState;function t(){var n=e.apply(history,arguments);I();return n}function r(){var e=n.apply(history,arguments);I();return e}history.pushState=t;history.replaceState=r}function x(){var e=v.notifications;if(e){e.onReady({updateNotifications:function(e){i.BBAuthInterop.postOmnibarMessage(l,{messageType:"notifications-update",notifications:e})}})}}function C(e){if(!i.BBAuthInterop.messageIsFromOmnibar(e)){return}var n=e.data;var t=v.nav;switch(n.messageType){case"ready":i.BBAuthInterop.postOmnibarMessage(l,{messageType:"host-ready"});P();i.BBAuthInterop.postOmnibarMessage(l,{enableHelp:v.enableHelp,envId:v.envId,localNavItems:t&&t.localNavItems,localNotifications:!!v.notifications,localSearch:!!v.onSearch,messageType:"nav-ready",services:t&&t.services,svcId:v.svcId});x();I();p();break;case"display-ready":f.classList.remove(c);l.classList.remove(c);break;case"expand":B();break;case"collapse":g();break;case"navigate-url":a.BBAuthNavigator.navigate(n.url);break;case"navigate":var r=n.navItem;if(!t||!t.beforeNavCallback||t.beforeNavCallback(r)!==false){a.BBAuthNavigator.navigate(r.url)}break;case"search":T(n.searchArgs);break;case"get-token":O(n.tokenRequestId,n.disableRedirect,v.legacyKeepAliveUrl);break;case"help-open":w();break;case"notification-read":S(n.notification);break;case"session-renew":o.BBOmnibarUserActivity.userRenewedSession();break;case"environment-update":N(n.name);break}}function R(){var e=v.url||"https://host.nxt.blackbaud.com/omnibar/";return e}var M=function(){function e(){}e.load=function(e){v=v=e;return new Promise(function(e){p=e;y();k();b();h();window.addEventListener("message",C)})};e.destroy=function(){document.head.removeChild(d);document.body.removeChild(f);document.body.removeChild(l);document.body.removeChild(u);window.removeEventListener("message",C);v=d=f=l=u=p=undefined};return e}();n.BBOmnibar=M}])});
(function e(n,t){if(typeof exports==="object"&&typeof module==="object")module.exports=t();else if(typeof define==="function"&&define.amd)define([],t);else if(typeof exports==="object")exports["BBAuthClient"]=t();else n["BBAuthClient"]=t()})(this,function(){return function(e){var n={};function t(r){if(n[r]){return n[r].exports}var i=n[r]={i:r,l:false,exports:{}};e[r].call(i.exports,i,i.exports,t);i.l=true;return i.exports}t.m=e;t.c=n;t.i=function(e){return e};t.d=function(e,n,r){if(!t.o(e,n)){Object.defineProperty(e,n,{configurable:false,enumerable:true,get:r})}};t.n=function(e){var n=e&&e.__esModule?function n(){return e["default"]}:function n(){return e};t.d(n,"a",n);return n};t.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)};t.p="";return t(t.s=5)}([function(e,n,t){"use strict";function r(e){for(var t in e)if(!n.hasOwnProperty(t))n[t]=e[t]}Object.defineProperty(n,"__esModule",{value:true});r(t(8));r(t(6))},function(e,n,t){"use strict";Object.defineProperty(n,"__esModule",{value:true});var r=t(0);var i="https://signin.blackbaud.com/signin/";var o="https://host.nxt.blackbaud.com/errors/";var a=encodeURIComponent;function s(e){var n=[];for(var t in e){if(e.hasOwnProperty(t)){n.push(a(t)+"="+a(e[t]))}}return n.join("&")}function c(e){var n=i+"?redirectUrl="+a(location.href);if(e){n+="&inactivity=1"}return n}var u=function(){function e(){}e.navigate=function(e,n){if(n){location.replace(e)}else{location.href=e}};e.redirectToSignin=function(e){var n=c();if(e){n+="&"+s(e)}this.navigate(n)};e.redirectToSignoutForInactivity=function(){var e=c(true);var n=i+"sign-out?redirectUrl="+a(e);this.navigate(n)};e.redirectToError=function(e){var n;var t;switch(e){case r.BBAuthTokenErrorCode.InvalidEnvironment:t="invalid_env";n="security";break;default:n="broken";break}var i=""+o+n+"?source=auth-client&url="+a(location.href);if(t){i+="&code="+a(t)}this.navigate(i)};return e}();n.BBAuthNavigator=u},function(e,n,t){"use strict";Object.defineProperty(n,"__esModule",{value:true});var r="https://s21aidntoken00blkbapp01.nxt.blackbaud.com/session/csrf";var i=t(0);var o=t(1);function a(e,n,t,r,o){var a=new XMLHttpRequest;a.onreadystatechange=function(){if(a.readyState===4){switch(a.status){case 200:r(a.responseText);break;case 401:o({code:i.BBAuthTokenErrorCode.NotLoggedIn,message:"The user is not logged in."});break;case 403:o({code:i.BBAuthTokenErrorCode.InvalidEnvironment,message:"The user is not a member of the specified environment."});break;default:if(a.status===0||a.status>=400){o({code:i.BBAuthTokenErrorCode.Unspecified,message:"An unknown error occurred."})}break}}};a.open("POST",e,true);a.setRequestHeader(n.name,n.value);a.setRequestHeader("Accept","application/json");a.setRequestHeader("Content-Type","application/json");a.withCredentials=true;if(t){a.send(JSON.stringify(t))}else{a.send()}}function s(e,n,t,r){var i;if(t){i={environment_id:t};if(r){i.permission_scope=r}}return new Promise(function(t,r){a(e,{name:"X-CSRF",value:n},i,function(e){var n=e?JSON.parse(e):undefined;t(n)},r)})}var c=function(){function e(){}e.request=function(e,n,t,a,c){if(c&&!a){return Promise.reject({code:i.BBAuthTokenErrorCode.PermissionScopeNoEnvironment,message:"You must also specify an environment when specifying a permission scope."})}return new Promise(function(u,f){s(r,"token_needed").then(function(n){return s(e,n["csrf_token"],a,c)}).then(u).catch(function(e){if(t){f(e)}else{switch(e.code){case i.BBAuthTokenErrorCode.NotLoggedIn:o.BBAuthNavigator.redirectToSignin(n);break;default:o.BBAuthNavigator.redirectToError(e.code);break}}})})};return e}();n.BBCsrfXhr=c},function(e,n,t){"use strict";Object.defineProperty(n,"__esModule",{value:true});var r="https://host.nxt.blackbaud.com";var i=function(){function e(){}e.postOmnibarMessage=function(e,n,t){n.source="auth-client";e.contentWindow.postMessage(n,t||r)};e.messageIsFromOmnibar=function(e){if(e.origin===r){var n=e.data;return!!n&&n.source==="skyux-spa-omnibar"}return false};return e}();n.BBAuthInterop=i},function(e,n,t){"use strict";function r(e){for(var t in e)if(!n.hasOwnProperty(t))n[t]=e[t]}Object.defineProperty(n,"__esModule",{value:true});r(t(15));r(t(9))},function(e,n,t){"use strict";function r(e){for(var t in e)if(!n.hasOwnProperty(t))n[t]=e[t]}Object.defineProperty(n,"__esModule",{value:true});r(t(0));r(t(4))},function(e,n,t){"use strict";Object.defineProperty(n,"__esModule",{value:true});var r;(function(e){e[e["Unspecified"]=0]="Unspecified";e[e["NotLoggedIn"]=1]="NotLoggedIn";e[e["InvalidEnvironment"]=2]="InvalidEnvironment";e[e["PermissionScopeNoEnvironment"]=3]="PermissionScopeNoEnvironment"})(r=n.BBAuthTokenErrorCode||(n.BBAuthTokenErrorCode={}))},function(e,n,t){"use strict";Object.defineProperty(n,"__esModule",{value:true});var r=t(2);var i=function(){function e(){}e.getToken=function(e,n,t){return r.BBCsrfXhr.request("https://s21aidntoken00blkbapp01.nxt.blackbaud.com/oauth2/token",undefined,e,n,t)};return e}();n.BBAuthTokenIntegration=i},function(e,n,t){"use strict";Object.defineProperty(n,"__esModule",{value:true});var r=t(7);function i(e){var n=e.envId,t=e.permissionScope;return"token|"+(n||"-")+"|"+(t||"-")}var o=function(){function e(){}e.getToken=function(n){return e.getTokenInternal(n)};e.clearTokenCache=function(){e.tokenCache={}};e.getTokenInternal=function(n){n=n||{};var t=n.forceNewToken,o=n.disableRedirect;if(e.mock){return Promise.resolve("mock_access_token_auth-client@blackbaud.com")}var a=i(n);var s=e.tokenCache[a]=e.tokenCache[a]||{};var c=(new Date).valueOf();if(!t&&s.lastToken&&s.expirationTime&&s.expirationTime-c>60*1e3){return Promise.resolve(s.lastToken)}if(!s.pendingLookupPromise){s.pendingLookupPromise=r.BBAuthTokenIntegration.getToken(o,n.envId,n.permissionScope).then(function(e){s.expirationTime=(new Date).valueOf()+e["expires_in"]*1e3;s.lastToken=e["access_token"];s.pendingLookupPromise=null;return s.lastToken}).catch(function(e){s.pendingLookupPromise=null;throw e})}return s.pendingLookupPromise};return e}();o.mock=false;o.tokenCache={};n.BBAuth=o},function(e,n,t){"use strict";Object.defineProperty(n,"__esModule",{value:true});var r=t(10);function i(){return window.jQuery}var o=function(){function e(){}e.load=function(e){return new Promise(function(n){var t=i();var o=t&&t.fn&&t.fn.jquery;r.BBOmnibarScriptLoader.smartRegisterScript("https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.0/jquery.js","2.1.0",o).then(function(){return r.BBOmnibarScriptLoader.registerScript("https://cdnjs.cloudflare.com/ajax/libs/easyXDM/2.4.17.1/easyXDM.min.js")}).then(function(){return r.BBOmnibarScriptLoader.registerScript("https://signin.blackbaud.com/Omnibar.min.js")}).then(function(){document.body.classList.add("bb-omnibar-height-padding");var t=document.createElement("div");t.setAttribute("data-omnibar-el","");document.body.appendChild(t);e=e||{};e["z-index"]=1e3;e.afterLoad=n;if(e.menuEl){e.menuEl=i()(e.menuEl)}BBAUTH.Omnibar.load(t,e)})})};return e}();n.BBOmnibarLegacy=o},function(e,n,t){"use strict";Object.defineProperty(n,"__esModule",{value:true});function r(e){var n=e.split(".");var t=[];for(var r=0,i=n;r<i.length;r++){var o=i[r];var a=parseInt(o,10)||0;t.push(a)}return t}function i(e,n){var t=r(e);var i=r(n);for(var o=0;o<t.length;o++){if(o<i.length){if(i[o]>t[o]){return true}else if(i[o]<t[o]){return false}}}return true}var o=function(){function e(){}e.registerScript=function(e){return new Promise(function(n,t){var r=document.createElement("script");r.onload=n;r.onerror=t;r.src=e;document.body.appendChild(r)})};e.smartRegisterScript=function(n,t,r){if(r&&i(t,r)){return Promise.resolve()}return e.registerScript(n)};return e}();n.BBOmnibarScriptLoader=o},function(e,n,t){"use strict";Object.defineProperty(n,"__esModule",{value:true});var r=function(){function e(){}e.process=function(e){var n=e.allowAnonymous,t=e.closeInactivityPrompt,r=e.expirationDate,i=e.inactivityPromptDuration,o=e.isShowingInactivityPrompt,a=e.lastActivity,s=e.maxSessionAge,c=e.minRenewalAge,u=e.redirectForInactivity,f=e.renewSession,d=e.showInactivityPrompt;var l=Date.now();if(r===null){return}if(!n&&l>r){u()}var v=r-i;var p=r-s+c;if(o){if(l<v){t()}}else{if(a>p){f()}else if(!n&&l>v){d()}}};return e}();n.BBOmnibarUserActivityProcessor=r},function(e,n,t){"use strict";Object.defineProperty(n,"__esModule",{value:true});var r=t(11);var i=t(13);var o=t(14);var a=t(2);var s=t(1);var c;var u;var f;var d;var l;var v;var p;var m;var h;var b;var g="";var y;var k;var B;var I;function T(){m=Date.now()}function E(e){if(e.clientX!==u||e.clientY!==f){u=e.clientX;f=e.clientY;T()}}function _(){var e=Date.now();if(!h||e-h>P.MIN_RENEWAL_RETRY){h=e;a.BBCsrfXhr.request("https://s21aidntoken00blkbapp01.nxt.blackbaud.com/session/renew",{inactivity:1}).catch(function(){return undefined})}}function A(){document.addEventListener("keypress",T);document.addEventListener("mousemove",E)}function O(){p=true;v()}function w(){p=false;T();d()}function S(){if(I){s.BBAuthNavigator.navigate(I)}else{s.BBAuthNavigator.redirectToSignoutForInactivity()}}function N(){if(!y){_()}b=setInterval(function(){i.BBOmnibarUserSessionExpiration.getSessionExpiration(g,B,y).then(function(e){r.BBOmnibarUserActivityProcessor.process({allowAnonymous:y,closeInactivityPrompt:w,expirationDate:e,inactivityPromptDuration:P.INACTIVITY_PROMPT_DURATION,isShowingInactivityPrompt:p,lastActivity:m,maxSessionAge:P.MAX_SESSION_AGE,minRenewalAge:P.MIN_RENEWAL_AGE,redirectForInactivity:S,renewSession:_,showInactivityPrompt:O})})},P.ACTIVITY_TIMER_INTERVAL)}var P=function(){function e(){}e.startTracking=function(n,t,r,i,a){if(!c||i!==y||a!==k){e.stopTracking();l=n;v=t;d=r;y=i;k=a;A();N();o.BBOmnibarUserSessionWatcher.start(i,a,l,function(e){B=e.legacyTtl;g=e.refreshId;I=e.legacySigninUrl});c=true}};e.userRenewedSession=function(){w();_()};e.stopTracking=function(){o.BBOmnibarUserSessionWatcher.stop();i.BBOmnibarUserSessionExpiration.reset();document.removeEventListener("keypress",T);document.removeEventListener("mousemove",E);if(b){clearInterval(b);b=undefined}c=u=f=m=h=p=l=v=d=y=k=undefined};return e}();P.ACTIVITY_TIMER_INTERVAL=1e3;P.MIN_RENEWAL_RETRY=1*60*1e3;P.INACTIVITY_PROMPT_DURATION=2*60*1e3;P.MIN_RENEWAL_AGE=5*60*1e3;P.MAX_SESSION_AGE=15*60*1e3;P.IDENTITY_SECURITY_TOKEN_SERVICE_ORIGIN="https://s21aidntoken00blkbapp01.nxt.blackbaud.com";n.BBOmnibarUserActivity=P},function(e,n,t){"use strict";Object.defineProperty(n,"__esModule",{value:true});var r=t(2);var i;function o(e,n){if(i&&i.refreshId===e&&i.allowAnonymous===n){return i.promise}var t=new Promise(function(e,t){r.BBCsrfXhr.request("https://s21aidntoken00blkbapp01.nxt.blackbaud.com/session/ttl",undefined,n).then(function(n){var t=n===null?null:Date.now()+n*1e3;e(t)},function(){e(null)})});i={allowAnonymous:n,promise:t,refreshId:e};return t}var a=function(){function e(){}e.getSessionExpiration=function(e,n,t){var r=o(e,t);return new Promise(function(e,t){r.then(function(t){var r;if(t===null){r=null}else if(typeof n==="number"){var i=Date.now()+n;r=Math.min(t,i)}else{r=t}e(r)})})};e.reset=function(){i=undefined};return e}();n.BBOmnibarUserSessionExpiration=a},function(e,n,t){"use strict";Object.defineProperty(n,"__esModule",{value:true});var r=t(3);var i=t(1);var o;var a;var s;var c;var u;var f;var d;var l={};var v;function p(e){if(e){var n=e.split("://");var t=n[0];var r=n[1].split("/")[0];return t+"://"+r}return undefined}function m(e){if(d){r.BBAuthInterop.postOmnibarMessage(d,e,p(a))}}function h(e,n){var t=document.createElement("iframe");t.className=e;t.width="0";t.height="0";t.frameBorder="0";t.src=n;t.tabIndex=-1;document.body.appendChild(t);return t}function b(){var e=I.IDENTITY_SECURITY_TOKEN_SERVICE_ORIGIN+"/SessionWatcher.html?origin="+encodeURIComponent(location.origin);f=h("sky-omnibar-iframe-session-watcher",e)}function g(){if(a){d=h("sky-omnibar-iframe-legacy-keep-alive",a)}}function y(e){if(typeof e.data==="string"){var n=void 0;try{n=JSON.parse(e.data)}catch(e){return}if(n.messageType==="session_change"){var t=n.message;var r=t&&t.sessionId;var o=t&&t.refreshId;if(!r&&!u){if(v){i.BBAuthNavigator.navigate(v)}else{i.BBAuthNavigator.redirectToSignin()}}if(l.refreshId!==undefined&&o!==l.refreshId){m({messageType:"session-refresh"})}if(l.sessionId!==undefined&&r!==l.sessionId){s()}l.refreshId=o;l.sessionId=r;c(l)}}}function k(e){var n=e.data;switch(n.messageType){case"ready":l.legacyTtl=n.ttl;v=n.signinUrl;c(l);break}}function B(e){switch(e.origin){case I.IDENTITY_SECURITY_TOKEN_SERVICE_ORIGIN:y(e);break;case p(a):k(e);break}}var I=function(){function e(){}e.start=function(n,t,r,i){if(!o||n!==u||t!==a){e.stop();u=n;s=r;a=t;c=i;b();g();window.addEventListener("message",B,false);o=true}};e.stop=function(){window.removeEventListener("message",B,false);if(f){document.body.removeChild(f);f=undefined}if(d){document.body.removeChild(d);d=undefined}l={};o=u=s=a=v=c=undefined};return e}();I.IDENTITY_SECURITY_TOKEN_SERVICE_ORIGIN="https://s21aidntoken00blkbapp01.nxt.blackbaud.com";n.BBOmnibarUserSessionWatcher=I},function(e,n,t){"use strict";Object.defineProperty(n,"__esModule",{value:true});var r=t(0);var i=t(3);var o=t(12);var a=t(1);var s="sky-omnibar-iframe-expanded";var c="sky-omnibar-loading";var u;var f;var d;var l;var v;var p;var m;function h(e){var n=document.body;if(n.firstChild){n.insertBefore(e,n.firstChild)}else{n.appendChild(e)}}function b(){l=document.createElement("iframe");l.className="sky-omnibar-iframe "+c;l.src=L();h(l)}function g(){u=document.createElement("div");u.className="sky-omnibar-environment";h(u)}function y(){l.classList.remove(s)}function k(){var e='\nbody {\n margin-top: 50px;\n}\n\n#bb-help-container {\n padding-top: 1px;\n}\n\n.sky-omnibar-iframe,\n.sky-omnibar-placeholder {\n border: none;\n height: 50px;\n width: 100%;\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n z-index: 1000;\n}\n\n.sky-omnibar-placeholder {\n background-color: #4d5259;\n border-top: 5px solid #00b4f1;\n display: none;\n}\n\n.sky-omnibar-placeholder.sky-omnibar-loading {\n display: block;\n}\n\n.sky-omnibar-iframe.sky-omnibar-loading {\n visibility: hidden;\n}\n\n.sky-omnibar-iframe-expanded {\n height: 100%;\n}\n\n.sky-omnibar-environment {\n background-color: #e1e1e3;\n color: #282b31;\n font-family: "Blackbaud Sans", "Open Sans", "Helvetica Neue", Arial, sans-serif;\n font-size: 12px;\n font-weight: 400;\n height: 0;\n line-height: 24px;\n overflow: hidden;\n padding: 0 15px;\n text-align: right;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.sky-omnibar-environment-visible .sky-omnibar-environment {\n height: 24px;\n}\n ';d=document.createElement("style");d.appendChild(document.createTextNode(e));document.head.appendChild(d)}function B(){f=document.createElement("div");f.className="sky-omnibar-placeholder "+c;document.body.appendChild(f)}function I(){l.classList.add(s)}function T(){i.BBAuthInterop.postOmnibarMessage(l,{href:document.location.href,messageType:"location-change"})}function E(e){if(v.onSearch){v.onSearch(e).then(function(e){i.BBAuthInterop.postOmnibarMessage(l,{messageType:"search-results",results:e})})}}function _(){function e(e){i.BBAuthInterop.postOmnibarMessage(l,{messageType:"refresh-user",token:e})}r.BBAuth.clearTokenCache();r.BBAuth.getToken({disableRedirect:true,forceNewToken:true}).then(e).catch(function(){return e(undefined)})}function A(){i.BBAuthInterop.postOmnibarMessage(l,{messageType:"inactivity-show"})}function O(){i.BBAuthInterop.postOmnibarMessage(l,{messageType:"inactivity-hide"})}function w(){o.BBOmnibarUserActivity.startTracking(_,A,O,v.allowAnonymous,p)}function S(e,n){r.BBAuth.getToken({disableRedirect:n}).then(function(n){w();i.BBAuthInterop.postOmnibarMessage(l,{messageType:"token",token:n,tokenRequestId:e})},function(n){w();i.BBAuthInterop.postOmnibarMessage(l,{messageType:"token-fail",reason:n,tokenRequestId:e})})}function N(){var e=window.BBHELP;if(e){e.HelpWidget.open()}}function P(e){var n=v.notifications;if(n&&n.onNotificationRead){n.onNotificationRead(e)}}function x(e){var n="sky-omnibar-environment-visible";var t=document.body.classList;e=e||"";u.innerText=e;if(e){t.add(n)}else{t.remove(n)}}function C(){var e=history.pushState;var n=history.replaceState;function t(){var n=e.apply(history,arguments);T();return n}function r(){var e=n.apply(history,arguments);T();return e}history.pushState=t;history.replaceState=r}function R(){var e=v.notifications;if(e){e.onReady({updateNotifications:function(e){i.BBAuthInterop.postOmnibarMessage(l,{messageType:"notifications-update",notifications:e})}})}}function M(e){if(!i.BBAuthInterop.messageIsFromOmnibar(e)){return}var n=e.data;var t=v.nav;switch(n.messageType){case"ready":i.BBAuthInterop.postOmnibarMessage(l,{messageType:"host-ready"});C();i.BBAuthInterop.postOmnibarMessage(l,{enableHelp:v.enableHelp,envId:v.envId,localNavItems:t&&t.localNavItems,localNotifications:!!v.notifications,localSearch:!!v.onSearch,messageType:"nav-ready",services:t&&t.services,svcId:v.svcId});R();T();m();break;case"display-ready":f.classList.remove(c);l.classList.remove(c);break;case"expand":I();break;case"collapse":y();break;case"navigate-url":a.BBAuthNavigator.navigate(n.url);break;case"navigate":var r=n.navItem;if(!t||!t.beforeNavCallback||t.beforeNavCallback(r)!==false){a.BBAuthNavigator.navigate(r.url)}break;case"search":E(n.searchArgs);break;case"get-token":S(n.tokenRequestId,n.disableRedirect);break;case"help-open":N();break;case"notification-read":P(n.notification);break;case"session-renew":o.BBOmnibarUserActivity.userRenewedSession();break;case"environment-update":x(n.name);break;case"legacy-keep-alive-url-change":p=n.url;w();break}}function L(){var e=v.url||"https://host.nxt.blackbaud.com/omnibar/";return e}var j=function(){function e(){}e.load=function(e){v=v=e;p=v.legacyKeepAliveUrl;return new Promise(function(e){m=e;k();B();g();b();window.addEventListener("message",M)})};e.destroy=function(){document.head.removeChild(d);document.body.removeChild(f);document.body.removeChild(l);document.body.removeChild(u);window.removeEventListener("message",M);v=d=f=l=u=m=undefined};return e}();n.BBOmnibar=j}])});

@@ -0,1 +1,5 @@

# 2.2.0 (2017-11-29)
- The legacy keep-alive URL can now be set by the omnibar through the navigation service response instead of being specified at load time. The `legacyKeepAliveUrl` property of `BBOmnibarConfig` should now be considered deprecated and will be removed in a future major version. (#56)
# 2.1.0 (2017-11-08)

@@ -2,0 +6,0 @@

@@ -1,1 +0,1 @@

{"name":"@blackbaud/auth-client","version":"2.1.0","description":"Provides methods for obtaining an authentication token from the Blackbaud authentication service.","main":"dist/bundles/auth-client.umd.js","module":"index.js","scripts":{"ci":"npm run test:ci && npm run build","test":"npm run lint && npm run test:unit","test:ci":"npm run test:unit:ci","test:unit":"npm run test:unit:base -- config/karma/local.karma.conf.js","test:unit:ci":"npm run test:unit:base -- config/karma/ci.karma.conf.js","test:unit:base":"node --max-old-space-size=4096 node_modules/karma/bin/karma start","pretest":"npm run lint","compress":"uglifyjs dist/bundles/auth-client.umd.js -m -o dist/bundles/auth-client.umd.min.js","build":"rimraf dist && tsc && webpack --config config/webpack/webpack.prod.config.js && npm run compress","watch":"npm run test:unit -- --auto-watch --no-single-run","lint":"tslint 'src/**/*.ts'"},"repository":{"type":"git","url":"git+https://github.com/blackbaud/auth-client.git"},"author":"Blackbaud, Inc.","license":"MIT","bugs":{"url":"https://github.com/blackbaud/auth-client/issues"},"homepage":"https://github.com/blackbaud/auth-client#readme","devDependencies":{"@types/core-js":"0.9.41","@types/jasmine":"2.5.47","@types/jasmine-ajax":"3.1.36","@types/webpack":"2.2.15","core-js":"2.4.1","fs-extra":"3.0.1","istanbul":"0.4.5","istanbul-instrumenter-loader":"0.1.0","jasmine":"2.6.0","jasmine-ajax":"3.3.1","karma":"1.7.0","karma-browserstack-launcher":"1.2.0","karma-chrome-launcher":"2.1.1","karma-coverage":"1.1.1","karma-firefox-launcher":"1.0.1","karma-jasmine":"1.1.0","karma-mocha-reporter":"2.2.3","karma-sourcemap-loader":"0.3.7","karma-webpack":"2.0.3","raw-loader":"0.5.1","remap-istanbul":"0.9.5","rimraf":"2.6.1","source-map-inline-loader":"github:blackbaud-bobbyearl/source-map-inline-loader","ts-loader":"2.0.3","tslint":"5.2.0","tslint-loader":"3.5.3","typescript":"2.3.2","uglify-js":"3.0.15","webpack":"2.5.1"}}
{"name":"@blackbaud/auth-client","version":"2.2.0","description":"Provides methods for obtaining an authentication token from the Blackbaud authentication service.","main":"dist/bundles/auth-client.umd.js","module":"index.js","scripts":{"ci":"npm run test:ci && npm run build","test":"npm run lint && npm run test:unit","test:ci":"npm run test:unit:ci","test:unit":"npm run test:unit:base -- config/karma/local.karma.conf.js","test:unit:ci":"npm run test:unit:base -- config/karma/ci.karma.conf.js","test:unit:base":"node --max-old-space-size=4096 node_modules/karma/bin/karma start","pretest":"npm run lint","compress":"uglifyjs dist/bundles/auth-client.umd.js -m -o dist/bundles/auth-client.umd.min.js","build":"rimraf dist && tsc && webpack --config config/webpack/webpack.prod.config.js && npm run compress","watch":"npm run test:unit -- --auto-watch --no-single-run","lint":"tslint 'src/**/*.ts'"},"repository":{"type":"git","url":"git+https://github.com/blackbaud/auth-client.git"},"author":"Blackbaud, Inc.","license":"MIT","bugs":{"url":"https://github.com/blackbaud/auth-client/issues"},"homepage":"https://github.com/blackbaud/auth-client#readme","devDependencies":{"@types/core-js":"0.9.41","@types/jasmine":"2.5.47","@types/jasmine-ajax":"3.1.36","@types/webpack":"2.2.15","core-js":"2.4.1","fs-extra":"3.0.1","istanbul":"0.4.5","istanbul-instrumenter-loader":"0.1.0","jasmine":"2.6.0","jasmine-ajax":"3.3.1","karma":"1.7.0","karma-browserstack-launcher":"1.2.0","karma-chrome-launcher":"2.1.1","karma-coverage":"1.1.1","karma-firefox-launcher":"1.0.1","karma-jasmine":"1.1.0","karma-mocha-reporter":"2.2.3","karma-sourcemap-loader":"0.3.7","karma-webpack":"2.0.3","raw-loader":"0.5.1","remap-istanbul":"0.9.5","rimraf":"2.6.1","source-map-inline-loader":"github:blackbaud-bobbyearl/source-map-inline-loader","ts-loader":"2.0.3","tslint":"5.2.0","tslint-loader":"3.5.3","typescript":"2.3.2","uglify-js":"3.0.15","webpack":"2.5.1"}}

@@ -20,2 +20,3 @@ "use strict";

var currentAllowAnonymous;
var currentLegacyKeepAliveUrl;
var legacyTtl;

@@ -95,3 +96,5 @@ var legacySigninUrl;

BBOmnibarUserActivity.startTracking = function (refreshUserCallback, showInactivityCallback, hideInactivityCallback, allowAnonymous, legacyKeepAliveUrl) {
if (!isTracking || allowAnonymous !== currentAllowAnonymous) {
if (!isTracking ||
allowAnonymous !== currentAllowAnonymous ||
legacyKeepAliveUrl !== currentLegacyKeepAliveUrl) {
BBOmnibarUserActivity.stopTracking();

@@ -102,2 +105,3 @@ currentRefreshUserCallback = refreshUserCallback;

currentAllowAnonymous = allowAnonymous;
currentLegacyKeepAliveUrl = legacyKeepAliveUrl;
addActivityListeners();

@@ -137,3 +141,4 @@ startActivityTimer();

currentAllowAnonymous =
undefined;
currentLegacyKeepAliveUrl =
undefined;
};

@@ -140,0 +145,0 @@ return BBOmnibarUserActivity;

@@ -113,3 +113,5 @@ "use strict";

BBOmnibarUserSessionWatcher.start = function (allowAnonymous, legacyKeepAliveUrl, refreshUserCallback, stateChange) {
if (!isWatching || allowAnonymous !== currentAllowAnonymous) {
if (!isWatching ||
allowAnonymous !== currentAllowAnonymous ||
legacyKeepAliveUrl !== currentLegacyKeepAliveUrl) {
BBOmnibarUserSessionWatcher.stop();

@@ -116,0 +118,0 @@ currentAllowAnonymous = allowAnonymous;

@@ -14,2 +14,3 @@ "use strict";

var omnibarConfig;
var currentLegacyKeepAliveUrl;
var promiseResolve;

@@ -98,6 +99,6 @@ function addElToBodyTop(el) {

}
function handleGetToken(tokenRequestId, disableRedirect, legacyKeepAliveUrl) {
function startActivityTracking() {
omnibar_user_activity_1.BBOmnibarUserActivity.startTracking(refreshUserCallback, showInactivityCallback, hideInactivityCallback, omnibarConfig.allowAnonymous, legacyKeepAliveUrl);
}
function startActivityTracking() {
omnibar_user_activity_1.BBOmnibarUserActivity.startTracking(refreshUserCallback, showInactivityCallback, hideInactivityCallback, omnibarConfig.allowAnonymous, currentLegacyKeepAliveUrl);
}
function handleGetToken(tokenRequestId, disableRedirect) {
auth_1.BBAuth.getToken({

@@ -229,3 +230,3 @@ disableRedirect: disableRedirect

case 'get-token':
handleGetToken(message.tokenRequestId, message.disableRedirect, omnibarConfig.legacyKeepAliveUrl);
handleGetToken(message.tokenRequestId, message.disableRedirect);
break;

@@ -244,2 +245,6 @@ case 'help-open':

break;
case 'legacy-keep-alive-url-change':
currentLegacyKeepAliveUrl = message.url;
startActivityTracking();
break;
}

@@ -258,2 +263,5 @@ }

omnibarConfig = omnibarConfig = config;
// TODO: Deprecate this and only allow it to come from the legacy-keep-alive-url-change message
// from the omnibar.
currentLegacyKeepAliveUrl = omnibarConfig.legacyKeepAliveUrl;
return new Promise(function (resolve) {

@@ -260,0 +268,0 @@ promiseResolve = resolve;

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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