@cosmotech/core 1.18.0-dev.0 → 1.18.0-dev.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.yarn/install-state.gz +0 -0
- package/dist/index.cjs.js +379 -132
- package/dist/index.esm.js +378 -132
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -41309,13 +41309,13 @@ var PathUtils = {
|
|
|
41309
41309
|
// Notes : local storage works on Chromium but not on Firefox if "Delete
|
|
41310
41310
|
// cookies and site data when Firefox is closed" is selected (for more
|
|
41311
41311
|
// details, see https://bugzilla.mozilla.org/show_bug.cgi?id=1453699)
|
|
41312
|
-
function writeToStorage$
|
|
41312
|
+
function writeToStorage$2(key, value) {
|
|
41313
41313
|
localStorage.setItem(key, value);
|
|
41314
41314
|
}
|
|
41315
|
-
function readFromStorage$
|
|
41315
|
+
function readFromStorage$3(key) {
|
|
41316
41316
|
return localStorage.getItem(key);
|
|
41317
41317
|
}
|
|
41318
|
-
function clearFromStorage$
|
|
41318
|
+
function clearFromStorage$2(key) {
|
|
41319
41319
|
localStorage.removeItem(key);
|
|
41320
41320
|
}
|
|
41321
41321
|
|
|
@@ -41351,7 +41351,7 @@ function setProvider(providerName) {
|
|
|
41351
41351
|
currentProvider.setAuthChangeCallbacks(onAuthChangeCallbacks);
|
|
41352
41352
|
}
|
|
41353
41353
|
// Store the provider used in local storage
|
|
41354
|
-
writeToStorage$
|
|
41354
|
+
writeToStorage$2('authProvider', providerName);
|
|
41355
41355
|
}
|
|
41356
41356
|
}
|
|
41357
41357
|
|
|
@@ -41360,77 +41360,77 @@ function setProvider(providerName) {
|
|
|
41360
41360
|
// this provider will be selected
|
|
41361
41361
|
function initProviderIfNull() {
|
|
41362
41362
|
if (currentProvider === undefined) {
|
|
41363
|
-
var newProviderName = readFromStorage$
|
|
41363
|
+
var newProviderName = readFromStorage$3('authProvider');
|
|
41364
41364
|
if (newProviderName !== undefined && newProviderName !== null) {
|
|
41365
41365
|
setProvider(newProviderName);
|
|
41366
41366
|
}
|
|
41367
41367
|
}
|
|
41368
41368
|
}
|
|
41369
|
-
function signIn$
|
|
41369
|
+
function signIn$3() {
|
|
41370
41370
|
return currentProvider.signIn();
|
|
41371
41371
|
}
|
|
41372
|
-
function signOut$
|
|
41372
|
+
function signOut$3() {
|
|
41373
41373
|
initProviderIfNull();
|
|
41374
41374
|
// Clear last auth provider used from local storage
|
|
41375
|
-
clearFromStorage$
|
|
41375
|
+
clearFromStorage$2('authProvider');
|
|
41376
41376
|
return currentProvider.signOut();
|
|
41377
41377
|
}
|
|
41378
41378
|
function onAuthStateChanged(newCallback) {
|
|
41379
41379
|
onAuthChangeCallbacks.push(newCallback);
|
|
41380
41380
|
}
|
|
41381
|
-
function isAsync$
|
|
41381
|
+
function isAsync$3() {
|
|
41382
41382
|
initProviderIfNull();
|
|
41383
41383
|
if (currentProvider && currentProvider.isAsync) {
|
|
41384
41384
|
return currentProvider.isAsync();
|
|
41385
41385
|
}
|
|
41386
41386
|
return false;
|
|
41387
41387
|
}
|
|
41388
|
-
function acquireTokens$
|
|
41388
|
+
function acquireTokens$3(callback) {
|
|
41389
41389
|
initProviderIfNull();
|
|
41390
41390
|
if (currentProvider === undefined) {
|
|
41391
41391
|
return undefined;
|
|
41392
41392
|
}
|
|
41393
41393
|
return currentProvider.acquireTokens(callback);
|
|
41394
41394
|
}
|
|
41395
|
-
function acquireTokensByRequest$
|
|
41395
|
+
function acquireTokensByRequest$3(tokenReq) {
|
|
41396
41396
|
initProviderIfNull();
|
|
41397
41397
|
if (currentProvider === undefined) {
|
|
41398
41398
|
return undefined;
|
|
41399
41399
|
}
|
|
41400
41400
|
return currentProvider.acquireTokensByRequest(tokenReq);
|
|
41401
41401
|
}
|
|
41402
|
-
function isUserSignedIn$
|
|
41402
|
+
function isUserSignedIn$3(callback) {
|
|
41403
41403
|
initProviderIfNull();
|
|
41404
41404
|
if (currentProvider === undefined) {
|
|
41405
41405
|
return false;
|
|
41406
41406
|
}
|
|
41407
41407
|
return currentProvider.isUserSignedIn(callback);
|
|
41408
41408
|
}
|
|
41409
|
-
function getUserEmail$
|
|
41409
|
+
function getUserEmail$3() {
|
|
41410
41410
|
if (currentProvider === undefined) {
|
|
41411
41411
|
return undefined;
|
|
41412
41412
|
}
|
|
41413
41413
|
return currentProvider.getUserEmail();
|
|
41414
41414
|
}
|
|
41415
|
-
function getUserName$
|
|
41415
|
+
function getUserName$3() {
|
|
41416
41416
|
if (currentProvider === undefined) {
|
|
41417
41417
|
return undefined;
|
|
41418
41418
|
}
|
|
41419
41419
|
return currentProvider.getUserName();
|
|
41420
41420
|
}
|
|
41421
|
-
function getUserRoles$
|
|
41421
|
+
function getUserRoles$3() {
|
|
41422
41422
|
if (currentProvider === undefined) {
|
|
41423
41423
|
return undefined;
|
|
41424
41424
|
}
|
|
41425
41425
|
return currentProvider.getUserRoles();
|
|
41426
41426
|
}
|
|
41427
|
-
function getUserId$
|
|
41427
|
+
function getUserId$3() {
|
|
41428
41428
|
if (currentProvider === undefined) {
|
|
41429
41429
|
return undefined;
|
|
41430
41430
|
}
|
|
41431
41431
|
return currentProvider.getUserId();
|
|
41432
41432
|
}
|
|
41433
|
-
function getUserPicUrl$
|
|
41433
|
+
function getUserPicUrl$3() {
|
|
41434
41434
|
if (currentProvider === undefined) {
|
|
41435
41435
|
return undefined;
|
|
41436
41436
|
}
|
|
@@ -41439,28 +41439,28 @@ function getUserPicUrl$2() {
|
|
|
41439
41439
|
var Auth = {
|
|
41440
41440
|
addProvider,
|
|
41441
41441
|
setProvider,
|
|
41442
|
-
signIn: signIn$
|
|
41443
|
-
signOut: signOut$
|
|
41442
|
+
signIn: signIn$3,
|
|
41443
|
+
signOut: signOut$3,
|
|
41444
41444
|
onAuthStateChanged,
|
|
41445
|
-
isUserSignedIn: isUserSignedIn$
|
|
41446
|
-
getUserEmail: getUserEmail$
|
|
41447
|
-
getUserName: getUserName$
|
|
41448
|
-
getUserId: getUserId$
|
|
41449
|
-
getUserRoles: getUserRoles$
|
|
41450
|
-
getUserPicUrl: getUserPicUrl$
|
|
41451
|
-
isAsync: isAsync$
|
|
41452
|
-
acquireTokens: acquireTokens$
|
|
41453
|
-
acquireTokensByRequest: acquireTokensByRequest$
|
|
41445
|
+
isUserSignedIn: isUserSignedIn$3,
|
|
41446
|
+
getUserEmail: getUserEmail$3,
|
|
41447
|
+
getUserName: getUserName$3,
|
|
41448
|
+
getUserId: getUserId$3,
|
|
41449
|
+
getUserRoles: getUserRoles$3,
|
|
41450
|
+
getUserPicUrl: getUserPicUrl$3,
|
|
41451
|
+
isAsync: isAsync$3,
|
|
41452
|
+
acquireTokens: acquireTokens$3,
|
|
41453
|
+
acquireTokensByRequest: acquireTokensByRequest$3
|
|
41454
41454
|
};
|
|
41455
41455
|
|
|
41456
41456
|
// Copyright (c) Cosmo Tech.
|
|
41457
41457
|
// Licensed under the MIT license.
|
|
41458
41458
|
|
|
41459
|
-
function readFromStorage$
|
|
41459
|
+
function readFromStorage$2(key) {
|
|
41460
41460
|
return localStorage.getItem(key);
|
|
41461
41461
|
}
|
|
41462
|
-
var name$
|
|
41463
|
-
var authData$
|
|
41462
|
+
var name$4 = 'auth-dev';
|
|
41463
|
+
var authData$2 = null;
|
|
41464
41464
|
var DEFAULT_AUTH_DATA = {
|
|
41465
41465
|
authenticated: true,
|
|
41466
41466
|
accountId: 'xxxxxxxx-xxxx-dave-xxxx-xxxxxxxxxxxx',
|
|
@@ -41471,75 +41471,75 @@ var DEFAULT_AUTH_DATA = {
|
|
|
41471
41471
|
};
|
|
41472
41472
|
|
|
41473
41473
|
// Optional configuration method to overwrite default values such as accountId, userEmail, userId, userName and roles
|
|
41474
|
-
function setConfig$
|
|
41475
|
-
authData$
|
|
41474
|
+
function setConfig$2(authDataPatch) {
|
|
41475
|
+
authData$2 = _objectSpread2(_objectSpread2({}, DEFAULT_AUTH_DATA), authDataPatch);
|
|
41476
41476
|
}
|
|
41477
41477
|
function setDefaultUser() {
|
|
41478
|
-
if (authData$
|
|
41479
|
-
authData$
|
|
41478
|
+
if (authData$2 != null) return;
|
|
41479
|
+
authData$2 = DEFAULT_AUTH_DATA;
|
|
41480
41480
|
}
|
|
41481
|
-
function signIn$
|
|
41481
|
+
function signIn$2() {
|
|
41482
41482
|
setDefaultUser();
|
|
41483
41483
|
window.location.href = '/';
|
|
41484
41484
|
}
|
|
41485
|
-
function signOut$
|
|
41486
|
-
authData$
|
|
41485
|
+
function signOut$2() {
|
|
41486
|
+
authData$2 = null;
|
|
41487
41487
|
window.location.href = '/';
|
|
41488
41488
|
}
|
|
41489
|
-
function isAsync$
|
|
41489
|
+
function isAsync$2() {
|
|
41490
41490
|
return false;
|
|
41491
41491
|
}
|
|
41492
|
-
function isUserSignedIn$
|
|
41492
|
+
function isUserSignedIn$2() {
|
|
41493
41493
|
setDefaultUser();
|
|
41494
41494
|
return true;
|
|
41495
41495
|
}
|
|
41496
|
-
function getUserEmail$
|
|
41496
|
+
function getUserEmail$2() {
|
|
41497
41497
|
var _authData;
|
|
41498
|
-
return (_authData = authData$
|
|
41498
|
+
return (_authData = authData$2) === null || _authData === void 0 ? void 0 : _authData.userEmail;
|
|
41499
41499
|
}
|
|
41500
|
-
function getUserName$
|
|
41500
|
+
function getUserName$2() {
|
|
41501
41501
|
var _authData2;
|
|
41502
|
-
return (_authData2 = authData$
|
|
41502
|
+
return (_authData2 = authData$2) === null || _authData2 === void 0 ? void 0 : _authData2.userName;
|
|
41503
41503
|
}
|
|
41504
|
-
function acquireTokens$
|
|
41505
|
-
var accessToken = readFromStorage$
|
|
41504
|
+
function acquireTokens$2() {
|
|
41505
|
+
var accessToken = readFromStorage$2('authAccessToken');
|
|
41506
41506
|
return accessToken ? {
|
|
41507
41507
|
accessToken
|
|
41508
41508
|
} : undefined;
|
|
41509
41509
|
}
|
|
41510
|
-
function acquireTokensByRequest$
|
|
41511
|
-
var accessToken = readFromStorage$
|
|
41510
|
+
function acquireTokensByRequest$2(tokenReq) {
|
|
41511
|
+
var accessToken = readFromStorage$2('authAccessToken');
|
|
41512
41512
|
return accessToken ? {
|
|
41513
41513
|
accessToken
|
|
41514
41514
|
} : undefined;
|
|
41515
41515
|
}
|
|
41516
|
-
function getUserId$
|
|
41517
|
-
if (authData$
|
|
41518
|
-
return authData$
|
|
41516
|
+
function getUserId$2() {
|
|
41517
|
+
if (authData$2) {
|
|
41518
|
+
return authData$2.userId;
|
|
41519
41519
|
}
|
|
41520
41520
|
return undefined;
|
|
41521
41521
|
}
|
|
41522
|
-
function getUserRoles$
|
|
41522
|
+
function getUserRoles$2() {
|
|
41523
41523
|
var _authData3;
|
|
41524
|
-
return (_authData3 = authData$
|
|
41524
|
+
return (_authData3 = authData$2) === null || _authData3 === void 0 ? void 0 : _authData3.roles;
|
|
41525
41525
|
}
|
|
41526
|
-
function getUserPicUrl$
|
|
41526
|
+
function getUserPicUrl$2() {
|
|
41527
41527
|
return undefined;
|
|
41528
41528
|
}
|
|
41529
41529
|
var AuthDev = {
|
|
41530
|
-
name: name$
|
|
41531
|
-
signIn: signIn$
|
|
41532
|
-
signOut: signOut$
|
|
41533
|
-
isUserSignedIn: isUserSignedIn$
|
|
41534
|
-
getUserEmail: getUserEmail$
|
|
41535
|
-
getUserName: getUserName$
|
|
41536
|
-
getUserRoles: getUserRoles$
|
|
41537
|
-
getUserId: getUserId$
|
|
41538
|
-
getUserPicUrl: getUserPicUrl$
|
|
41539
|
-
isAsync: isAsync$
|
|
41540
|
-
setConfig: setConfig$
|
|
41541
|
-
acquireTokens: acquireTokens$
|
|
41542
|
-
acquireTokensByRequest: acquireTokensByRequest$
|
|
41530
|
+
name: name$4,
|
|
41531
|
+
signIn: signIn$2,
|
|
41532
|
+
signOut: signOut$2,
|
|
41533
|
+
isUserSignedIn: isUserSignedIn$2,
|
|
41534
|
+
getUserEmail: getUserEmail$2,
|
|
41535
|
+
getUserName: getUserName$2,
|
|
41536
|
+
getUserRoles: getUserRoles$2,
|
|
41537
|
+
getUserId: getUserId$2,
|
|
41538
|
+
getUserPicUrl: getUserPicUrl$2,
|
|
41539
|
+
isAsync: isAsync$2,
|
|
41540
|
+
setConfig: setConfig$2,
|
|
41541
|
+
acquireTokens: acquireTokens$2,
|
|
41542
|
+
acquireTokensByRequest: acquireTokensByRequest$2
|
|
41543
41543
|
};
|
|
41544
41544
|
|
|
41545
41545
|
/*! @azure/msal-common v14.14.0 2024-07-23 */
|
|
@@ -44674,7 +44674,7 @@ class Logger {
|
|
|
44674
44674
|
|
|
44675
44675
|
/*! @azure/msal-common v14.14.0 2024-07-23 */
|
|
44676
44676
|
/* eslint-disable header/header */
|
|
44677
|
-
const name$
|
|
44677
|
+
const name$3 = "@azure/msal-common";
|
|
44678
44678
|
const version$1 = "14.14.0";
|
|
44679
44679
|
|
|
44680
44680
|
/*! @azure/msal-common v14.14.0 2024-07-23 */
|
|
@@ -45310,7 +45310,7 @@ class CacheManager {
|
|
|
45310
45310
|
constructor(clientId, cryptoImpl, logger, staticAuthorityOptions) {
|
|
45311
45311
|
this.clientId = clientId;
|
|
45312
45312
|
this.cryptoImpl = cryptoImpl;
|
|
45313
|
-
this.commonLogger = logger.clone(name$
|
|
45313
|
+
this.commonLogger = logger.clone(name$3, version$1);
|
|
45314
45314
|
this.staticAuthorityOptions = staticAuthorityOptions;
|
|
45315
45315
|
}
|
|
45316
45316
|
/**
|
|
@@ -47277,7 +47277,7 @@ class BaseClient {
|
|
|
47277
47277
|
// Set the configuration
|
|
47278
47278
|
this.config = buildClientConfiguration(configuration);
|
|
47279
47279
|
// Initialize the logger
|
|
47280
|
-
this.logger = new Logger(this.config.loggerOptions, name$
|
|
47280
|
+
this.logger = new Logger(this.config.loggerOptions, name$3, version$1);
|
|
47281
47281
|
// Initialize crypto
|
|
47282
47282
|
this.cryptoUtils = this.config.cryptoInterface;
|
|
47283
47283
|
// Initialize storage interface
|
|
@@ -50193,7 +50193,7 @@ function buildConfiguration({ auth: userInputAuth, cache: userInputCache, system
|
|
|
50193
50193
|
|
|
50194
50194
|
/*! @azure/msal-browser v3.20.0 2024-07-23 */
|
|
50195
50195
|
/* eslint-disable header/header */
|
|
50196
|
-
const name$
|
|
50196
|
+
const name$2 = "@azure/msal-browser";
|
|
50197
50197
|
const version = "3.20.0";
|
|
50198
50198
|
|
|
50199
50199
|
/*! @azure/msal-browser v3.20.0 2024-07-23 */
|
|
@@ -50268,7 +50268,7 @@ class BaseOperatingContext {
|
|
|
50268
50268
|
if (piiLoggingEnabled !== undefined) {
|
|
50269
50269
|
loggerOptions.piiLoggingEnabled = piiLoggingEnabled;
|
|
50270
50270
|
}
|
|
50271
|
-
this.logger = new Logger(loggerOptions, name$
|
|
50271
|
+
this.logger = new Logger(loggerOptions, name$2, version);
|
|
50272
50272
|
this.available = false;
|
|
50273
50273
|
}
|
|
50274
50274
|
/**
|
|
@@ -57265,55 +57265,55 @@ class PublicClientApplication {
|
|
|
57265
57265
|
// Notes : local storage works on Chromium but not on Firefox if "Delete
|
|
57266
57266
|
// cookies and site data when Firefox is closed" is selected (for more
|
|
57267
57267
|
// details, see https://bugzilla.mozilla.org/show_bug.cgi?id=1453699)
|
|
57268
|
-
var writeToStorage = (key, value) => {
|
|
57268
|
+
var writeToStorage$1 = (key, value) => {
|
|
57269
57269
|
localStorage.setItem(key, value);
|
|
57270
57270
|
};
|
|
57271
|
-
var readFromStorage = key => {
|
|
57271
|
+
var readFromStorage$1 = key => {
|
|
57272
57272
|
return localStorage.getItem(key);
|
|
57273
57273
|
};
|
|
57274
|
-
var clearFromStorage = key => {
|
|
57274
|
+
var clearFromStorage$1 = key => {
|
|
57275
57275
|
localStorage.removeItem(key);
|
|
57276
57276
|
};
|
|
57277
|
-
var name = 'auth-
|
|
57278
|
-
var authData = {
|
|
57279
|
-
authenticated: readFromStorage('authAuthenticated') === 'true',
|
|
57277
|
+
var name$1 = 'auth-keycloakPopupExperimental';
|
|
57278
|
+
var authData$1 = {
|
|
57279
|
+
authenticated: readFromStorage$1('authAuthenticated') === 'true',
|
|
57280
57280
|
accountId: undefined,
|
|
57281
57281
|
userEmail: undefined,
|
|
57282
57282
|
username: undefined,
|
|
57283
57283
|
userId: undefined,
|
|
57284
57284
|
roles: []
|
|
57285
57285
|
};
|
|
57286
|
-
var config = null;
|
|
57287
|
-
var msalApp = null;
|
|
57288
|
-
var setConfig = /*#__PURE__*/function () {
|
|
57286
|
+
var config$1 = null;
|
|
57287
|
+
var msalApp$1 = null;
|
|
57288
|
+
var setConfig$1 = /*#__PURE__*/function () {
|
|
57289
57289
|
var _ref = _asyncToGenerator(function* (newConfig) {
|
|
57290
|
-
config = newConfig;
|
|
57291
|
-
msalApp = new PublicClientApplication(config.msalConfig);
|
|
57292
|
-
yield msalApp.initialize();
|
|
57290
|
+
config$1 = newConfig;
|
|
57291
|
+
msalApp$1 = new PublicClientApplication(config$1.msalConfig);
|
|
57292
|
+
yield msalApp$1.initialize();
|
|
57293
57293
|
});
|
|
57294
57294
|
return function setConfig(_x) {
|
|
57295
57295
|
return _ref.apply(this, arguments);
|
|
57296
57296
|
};
|
|
57297
57297
|
}();
|
|
57298
|
-
var checkInit = () => {
|
|
57299
|
-
if (msalApp === null) {
|
|
57300
|
-
console.error('AuthMSAL module has not been initialized. Make sure you ' + 'call the setConfig const when = you add the AuthMSAL provider
|
|
57298
|
+
var checkInit$1 = () => {
|
|
57299
|
+
if (msalApp$1 === null) {
|
|
57300
|
+
console.error('AuthMSAL module has not been initialized. Make sure you ' + 'call the setConfig const when = you add the AuthMSAL provider.');
|
|
57301
57301
|
return false;
|
|
57302
57302
|
}
|
|
57303
57303
|
return true;
|
|
57304
57304
|
};
|
|
57305
|
-
var redirectOnAuthSuccess = () => {
|
|
57305
|
+
var redirectOnAuthSuccess$1 = () => {
|
|
57306
57306
|
var _config$msalConfig$au, _config;
|
|
57307
|
-
window.location.href = (_config$msalConfig$au = (_config = config) === null || _config === void 0 || (_config = _config.msalConfig) === null || _config === void 0 || (_config = _config.auth) === null || _config === void 0 ? void 0 : _config.redirectUri) !== null && _config$msalConfig$au !== void 0 ? _config$msalConfig$au : '/';
|
|
57307
|
+
window.location.href = (_config$msalConfig$au = (_config = config$1) === null || _config === void 0 || (_config = _config.msalConfig) === null || _config === void 0 || (_config = _config.auth) === null || _config === void 0 ? void 0 : _config.redirectUri) !== null && _config$msalConfig$au !== void 0 ? _config$msalConfig$au : '/';
|
|
57308
57308
|
};
|
|
57309
|
-
var _acquireTokensByRequestAndAccount = /*#__PURE__*/function () {
|
|
57309
|
+
var _acquireTokensByRequestAndAccount$1 = /*#__PURE__*/function () {
|
|
57310
57310
|
var _ref2 = _asyncToGenerator(function* (tokenReq, account) {
|
|
57311
57311
|
if (!tokenReq) {
|
|
57312
57312
|
console.warn('No base access token request provided');
|
|
57313
57313
|
tokenReq = {};
|
|
57314
57314
|
}
|
|
57315
57315
|
tokenReq.account = account;
|
|
57316
|
-
return yield msalApp.acquireTokenSilent(tokenReq).then(tokenRes => tokenRes).catch(silentTokenFetchError => {
|
|
57316
|
+
return yield msalApp$1.acquireTokenSilent(tokenReq).then(tokenRes => tokenRes).catch(silentTokenFetchError => {
|
|
57317
57317
|
var _silentTokenFetchErro;
|
|
57318
57318
|
if (silentTokenFetchError.errorCode === 'no_tokens_found') {
|
|
57319
57319
|
// No token found during acquireTokenSilent, ignore this error, nothing to do
|
|
@@ -57322,7 +57322,7 @@ var _acquireTokensByRequestAndAccount = /*#__PURE__*/function () {
|
|
|
57322
57322
|
console.warn('Silent authentication not possible, user is not logged in. This usually happens when the user session ' + 'has expired. Please try to log in again.');
|
|
57323
57323
|
return;
|
|
57324
57324
|
} else if (((_silentTokenFetchErro = silentTokenFetchError.errorMessage) === null || _silentTokenFetchErro === void 0 ? void 0 : _silentTokenFetchErro.indexOf('interaction_required')) !== -1) {
|
|
57325
|
-
msalApp.acquireTokenPopup(tokenReq).then(tokenRes => tokenRes) // Token acquired with interaction
|
|
57325
|
+
msalApp$1.acquireTokenPopup(tokenReq).then(tokenRes => tokenRes) // Token acquired with interaction
|
|
57326
57326
|
.catch(popupTokenFetchError => popupTokenFetchError); // Token retrieval failed
|
|
57327
57327
|
}
|
|
57328
57328
|
throw silentTokenFetchError;
|
|
@@ -57332,44 +57332,44 @@ var _acquireTokensByRequestAndAccount = /*#__PURE__*/function () {
|
|
|
57332
57332
|
return _ref2.apply(this, arguments);
|
|
57333
57333
|
};
|
|
57334
57334
|
}();
|
|
57335
|
-
var acquireTokens = /*#__PURE__*/function () {
|
|
57335
|
+
var acquireTokens$1 = /*#__PURE__*/function () {
|
|
57336
57336
|
var _ref3 = _asyncToGenerator(function* () {
|
|
57337
57337
|
var _msalApp$getAllAccoun;
|
|
57338
|
-
if (!checkInit()) return;
|
|
57339
|
-
var idToken = readFromStorage('authIdToken');
|
|
57340
|
-
var accessToken = readFromStorage('authAccessToken');
|
|
57341
|
-
var authenticated = readFromStorage('authAuthenticated') === 'true';
|
|
57338
|
+
if (!checkInit$1()) return;
|
|
57339
|
+
var idToken = readFromStorage$1('authIdToken');
|
|
57340
|
+
var accessToken = readFromStorage$1('authAccessToken');
|
|
57341
|
+
var authenticated = readFromStorage$1('authAuthenticated') === 'true';
|
|
57342
57342
|
if (authenticated && idToken != null && accessToken != null) {
|
|
57343
57343
|
return {
|
|
57344
57344
|
accessToken,
|
|
57345
57345
|
idToken
|
|
57346
57346
|
};
|
|
57347
57347
|
}
|
|
57348
|
-
var account = (_msalApp$getAllAccoun = msalApp.getAllAccounts()) === null || _msalApp$getAllAccoun === void 0 ? void 0 : _msalApp$getAllAccoun[0];
|
|
57349
|
-
var tokenReq = config.accessRequest;
|
|
57348
|
+
var account = (_msalApp$getAllAccoun = msalApp$1.getAllAccounts()) === null || _msalApp$getAllAccoun === void 0 ? void 0 : _msalApp$getAllAccoun[0];
|
|
57349
|
+
var tokenReq = config$1.accessRequest;
|
|
57350
57350
|
if (account === undefined) {
|
|
57351
57351
|
return undefined;
|
|
57352
57352
|
}
|
|
57353
|
-
return yield _acquireTokensByRequestAndAccount(tokenReq, account);
|
|
57353
|
+
return yield _acquireTokensByRequestAndAccount$1(tokenReq, account);
|
|
57354
57354
|
});
|
|
57355
57355
|
return function acquireTokens() {
|
|
57356
57356
|
return _ref3.apply(this, arguments);
|
|
57357
57357
|
};
|
|
57358
57358
|
}();
|
|
57359
|
-
var acquireTokensByRequest = /*#__PURE__*/function () {
|
|
57359
|
+
var acquireTokensByRequest$1 = /*#__PURE__*/function () {
|
|
57360
57360
|
var _ref4 = _asyncToGenerator(function* (tokenReq) {
|
|
57361
57361
|
var _msalApp$getAllAccoun2;
|
|
57362
|
-
if (!checkInit()) return;
|
|
57363
|
-
var account = (_msalApp$getAllAccoun2 = msalApp.getAllAccounts()) === null || _msalApp$getAllAccoun2 === void 0 ? void 0 : _msalApp$getAllAccoun2[0];
|
|
57364
|
-
return yield _acquireTokensByRequestAndAccount(tokenReq, account);
|
|
57362
|
+
if (!checkInit$1()) return;
|
|
57363
|
+
var account = (_msalApp$getAllAccoun2 = msalApp$1.getAllAccounts()) === null || _msalApp$getAllAccoun2 === void 0 ? void 0 : _msalApp$getAllAccoun2[0];
|
|
57364
|
+
return yield _acquireTokensByRequestAndAccount$1(tokenReq, account);
|
|
57365
57365
|
});
|
|
57366
57366
|
return function acquireTokensByRequest(_x4) {
|
|
57367
57367
|
return _ref4.apply(this, arguments);
|
|
57368
57368
|
};
|
|
57369
57369
|
}();
|
|
57370
57370
|
var selectAccount = () => {
|
|
57371
|
-
if (!checkInit()) return;
|
|
57372
|
-
var accounts = msalApp.getAllAccounts();
|
|
57371
|
+
if (!checkInit$1()) return;
|
|
57372
|
+
var accounts = msalApp$1.getAllAccounts();
|
|
57373
57373
|
if (accounts.length === 0) {
|
|
57374
57374
|
return;
|
|
57375
57375
|
}
|
|
@@ -57377,47 +57377,47 @@ var selectAccount = () => {
|
|
|
57377
57377
|
if (accounts.length > 1) {
|
|
57378
57378
|
console.warn('Several accounts detected, using the first one by default.');
|
|
57379
57379
|
}
|
|
57380
|
-
authData.authenticated = true;
|
|
57380
|
+
authData$1.authenticated = true;
|
|
57381
57381
|
var account = accounts[0];
|
|
57382
|
-
authData.accountId = account.homeAccountId;
|
|
57383
|
-
authData.userEmail = account.username; // In MSAL account data, username property contains user email
|
|
57384
|
-
authData.username = account.name;
|
|
57385
|
-
authData.userId = account.localAccountId;
|
|
57386
|
-
redirectOnAuthSuccess();
|
|
57382
|
+
authData$1.accountId = account.homeAccountId;
|
|
57383
|
+
authData$1.userEmail = account.username; // In MSAL account data, username property contains user email
|
|
57384
|
+
authData$1.username = account.name;
|
|
57385
|
+
authData$1.userId = account.localAccountId;
|
|
57386
|
+
redirectOnAuthSuccess$1();
|
|
57387
57387
|
};
|
|
57388
|
-
var handleResponse = response => {
|
|
57388
|
+
var handleResponse$1 = response => {
|
|
57389
57389
|
if (response == null) {
|
|
57390
57390
|
selectAccount();
|
|
57391
57391
|
return;
|
|
57392
57392
|
}
|
|
57393
|
-
writeToStorage('authIdTokenPopup', response.idToken);
|
|
57394
|
-
writeToStorage('authIdToken', response.idToken);
|
|
57395
|
-
writeToStorage('authAccessToken', response.accessToken);
|
|
57396
|
-
writeToStorage('authAuthenticated', 'true');
|
|
57397
|
-
authData.authenticated = true;
|
|
57393
|
+
writeToStorage$1('authIdTokenPopup', response.idToken);
|
|
57394
|
+
writeToStorage$1('authIdToken', response.idToken);
|
|
57395
|
+
writeToStorage$1('authAccessToken', response.accessToken);
|
|
57396
|
+
writeToStorage$1('authAuthenticated', 'true');
|
|
57397
|
+
authData$1.authenticated = true;
|
|
57398
57398
|
var account = response.account;
|
|
57399
|
-
authData.accountId = account.homeAccountId;
|
|
57400
|
-
authData.userEmail = account.username; // In MSAL account data, username property contains user email
|
|
57401
|
-
authData.username = account.name;
|
|
57402
|
-
authData.userId = account.localAccountId;
|
|
57403
|
-
redirectOnAuthSuccess();
|
|
57399
|
+
authData$1.accountId = account.homeAccountId;
|
|
57400
|
+
authData$1.userEmail = account.username; // In MSAL account data, username property contains user email
|
|
57401
|
+
authData$1.username = account.name;
|
|
57402
|
+
authData$1.userId = account.localAccountId;
|
|
57403
|
+
redirectOnAuthSuccess$1();
|
|
57404
57404
|
};
|
|
57405
|
-
var signIn = () => {
|
|
57406
|
-
if (!checkInit()) return;
|
|
57405
|
+
var signIn$1 = () => {
|
|
57406
|
+
if (!checkInit$1()) return;
|
|
57407
57407
|
|
|
57408
57408
|
// Force removal of MSAL interaction status if it exists in session storage (it happens sometimes after logout)
|
|
57409
57409
|
var itemKey = 'msal.interaction.status';
|
|
57410
57410
|
if (sessionStorage.getItem(itemKey)) {
|
|
57411
57411
|
sessionStorage.removeItem(itemKey);
|
|
57412
57412
|
}
|
|
57413
|
-
return msalApp.loginPopup(config.loginRequest).then(handleResponse).catch(error => {
|
|
57413
|
+
return msalApp$1.loginPopup(config$1.loginRequest).then(handleResponse$1).catch(error => {
|
|
57414
57414
|
var _error$errorMessage;
|
|
57415
57415
|
// Error handling
|
|
57416
57416
|
// Check for forgot password error
|
|
57417
57417
|
// Learn more about AAD error codes at
|
|
57418
57418
|
// https://docs.microsoft.com/en-us/azure/active-directory/develop/reference-aadsts-error-codes
|
|
57419
57419
|
if (((_error$errorMessage = error.errorMessage) === null || _error$errorMessage === void 0 ? void 0 : _error$errorMessage.indexOf('AADB2C90118')) > -1) {
|
|
57420
|
-
msalApp.loginPopup(config.b2cPolicies.authorities.forgotPassword).then(response => {
|
|
57420
|
+
msalApp$1.loginPopup(config$1.b2cPolicies.authorities.forgotPassword).then(response => {
|
|
57421
57421
|
window.alert('Password has been reset successfully. \nPlease sign-in with your new password.');
|
|
57422
57422
|
});
|
|
57423
57423
|
} else if (error.errorCode === 'user_cancelled') ; else {
|
|
@@ -57425,6 +57425,252 @@ var signIn = () => {
|
|
|
57425
57425
|
}
|
|
57426
57426
|
});
|
|
57427
57427
|
};
|
|
57428
|
+
var signOut$1 = () => {
|
|
57429
|
+
if (!checkInit$1()) return;
|
|
57430
|
+
clearFromStorage$1('authIdTokenPopup');
|
|
57431
|
+
clearFromStorage$1('authIdToken');
|
|
57432
|
+
clearFromStorage$1('authAccessToken');
|
|
57433
|
+
writeToStorage$1('authAuthenticated', 'false');
|
|
57434
|
+
// return;
|
|
57435
|
+
var logoutRequest = {
|
|
57436
|
+
account: msalApp$1.getAccountByHomeId(authData$1.accountId)
|
|
57437
|
+
};
|
|
57438
|
+
msalApp$1.logoutRedirect(logoutRequest);
|
|
57439
|
+
};
|
|
57440
|
+
|
|
57441
|
+
// Returns a boolean value, stating whether the isUserSignedIn must be provided a callback
|
|
57442
|
+
var isAsync$1 = () => {
|
|
57443
|
+
return false;
|
|
57444
|
+
};
|
|
57445
|
+
var _extractRolesFromAccessToken$1 = accessToken => {
|
|
57446
|
+
var result = [];
|
|
57447
|
+
if (accessToken) {
|
|
57448
|
+
var decodedToken = JSON.parse(atob(accessToken.split('.')[1]));
|
|
57449
|
+
if (decodedToken !== null && decodedToken !== void 0 && decodedToken.roles) {
|
|
57450
|
+
result = decodedToken === null || decodedToken === void 0 ? void 0 : decodedToken.roles;
|
|
57451
|
+
}
|
|
57452
|
+
}
|
|
57453
|
+
return result;
|
|
57454
|
+
};
|
|
57455
|
+
var isUserSignedIn$1 = /*#__PURE__*/function () {
|
|
57456
|
+
var _ref5 = _asyncToGenerator(function* () {
|
|
57457
|
+
// Return true if already authenticated
|
|
57458
|
+
if (authData$1.authenticated) return true;
|
|
57459
|
+
if (readFromStorage$1('authAuthenticated') === 'true') {
|
|
57460
|
+
authData$1.authenticated = true;
|
|
57461
|
+
return true;
|
|
57462
|
+
}
|
|
57463
|
+
|
|
57464
|
+
// Otherwise, try to acquire a token silently to implement SSO
|
|
57465
|
+
var tokens = yield acquireTokens$1();
|
|
57466
|
+
if ((tokens === null || tokens === void 0 ? void 0 : tokens.idToken) !== undefined) {
|
|
57467
|
+
writeToStorage$1('authIdToken', tokens.idToken);
|
|
57468
|
+
}
|
|
57469
|
+
if ((tokens === null || tokens === void 0 ? void 0 : tokens.accessToken) !== undefined) {
|
|
57470
|
+
var accessToken = tokens.accessToken;
|
|
57471
|
+
authData$1.roles = _extractRolesFromAccessToken$1(accessToken);
|
|
57472
|
+
writeToStorage$1('authAccessToken', accessToken);
|
|
57473
|
+
return true;
|
|
57474
|
+
}
|
|
57475
|
+
return false;
|
|
57476
|
+
});
|
|
57477
|
+
return function isUserSignedIn() {
|
|
57478
|
+
return _ref5.apply(this, arguments);
|
|
57479
|
+
};
|
|
57480
|
+
}();
|
|
57481
|
+
var getUserEmail$1 = () => {
|
|
57482
|
+
var _authData$userEmail, _msalApp$getAllAccoun3;
|
|
57483
|
+
if (!checkInit$1()) return;
|
|
57484
|
+
// Note: account data from MSAL seems to contain user email in the 'username' property
|
|
57485
|
+
return (_authData$userEmail = authData$1 === null || authData$1 === void 0 ? void 0 : authData$1.userEmail) !== null && _authData$userEmail !== void 0 ? _authData$userEmail : (_msalApp$getAllAccoun3 = msalApp$1.getAllAccounts()) === null || _msalApp$getAllAccoun3 === void 0 || (_msalApp$getAllAccoun3 = _msalApp$getAllAccoun3[0]) === null || _msalApp$getAllAccoun3 === void 0 ? void 0 : _msalApp$getAllAccoun3.username;
|
|
57486
|
+
};
|
|
57487
|
+
var getUserName$1 = () => {
|
|
57488
|
+
var _authData$name, _msalApp$getAllAccoun4;
|
|
57489
|
+
if (!checkInit$1()) return;
|
|
57490
|
+
return (_authData$name = authData$1 === null || authData$1 === void 0 ? void 0 : authData$1.name) !== null && _authData$name !== void 0 ? _authData$name : (_msalApp$getAllAccoun4 = msalApp$1.getAllAccounts()) === null || _msalApp$getAllAccoun4 === void 0 || (_msalApp$getAllAccoun4 = _msalApp$getAllAccoun4[0]) === null || _msalApp$getAllAccoun4 === void 0 ? void 0 : _msalApp$getAllAccoun4.name;
|
|
57491
|
+
};
|
|
57492
|
+
var getUserId$1 = () => {
|
|
57493
|
+
var _authData$userId, _msalApp$getAllAccoun5;
|
|
57494
|
+
if (!checkInit$1()) return;
|
|
57495
|
+
return (_authData$userId = authData$1 === null || authData$1 === void 0 ? void 0 : authData$1.userId) !== null && _authData$userId !== void 0 ? _authData$userId : (_msalApp$getAllAccoun5 = msalApp$1.getAllAccounts()) === null || _msalApp$getAllAccoun5 === void 0 || (_msalApp$getAllAccoun5 = _msalApp$getAllAccoun5[0]) === null || _msalApp$getAllAccoun5 === void 0 ? void 0 : _msalApp$getAllAccoun5.localAccountId;
|
|
57496
|
+
};
|
|
57497
|
+
var getUserRoles$1 = () => {
|
|
57498
|
+
if (!checkInit$1()) return;
|
|
57499
|
+
return authData$1.roles;
|
|
57500
|
+
};
|
|
57501
|
+
var getUserPicUrl$1 = () => {
|
|
57502
|
+
return undefined;
|
|
57503
|
+
};
|
|
57504
|
+
|
|
57505
|
+
var AuthKeycloakPopupExperimental = /*#__PURE__*/Object.freeze({
|
|
57506
|
+
__proto__: null,
|
|
57507
|
+
acquireTokens: acquireTokens$1,
|
|
57508
|
+
acquireTokensByRequest: acquireTokensByRequest$1,
|
|
57509
|
+
getUserEmail: getUserEmail$1,
|
|
57510
|
+
getUserId: getUserId$1,
|
|
57511
|
+
getUserName: getUserName$1,
|
|
57512
|
+
getUserPicUrl: getUserPicUrl$1,
|
|
57513
|
+
getUserRoles: getUserRoles$1,
|
|
57514
|
+
isAsync: isAsync$1,
|
|
57515
|
+
isUserSignedIn: isUserSignedIn$1,
|
|
57516
|
+
name: name$1,
|
|
57517
|
+
setConfig: setConfig$1,
|
|
57518
|
+
signIn: signIn$1,
|
|
57519
|
+
signOut: signOut$1
|
|
57520
|
+
});
|
|
57521
|
+
|
|
57522
|
+
// Functions to read & write from storage.
|
|
57523
|
+
// Notes : local storage works on Chromium but not on Firefox if "Delete
|
|
57524
|
+
// cookies and site data when Firefox is closed" is selected (for more
|
|
57525
|
+
// details, see https://bugzilla.mozilla.org/show_bug.cgi?id=1453699)
|
|
57526
|
+
var writeToStorage = (key, value) => {
|
|
57527
|
+
localStorage.setItem(key, value);
|
|
57528
|
+
};
|
|
57529
|
+
var readFromStorage = key => {
|
|
57530
|
+
return localStorage.getItem(key);
|
|
57531
|
+
};
|
|
57532
|
+
var clearFromStorage = key => {
|
|
57533
|
+
localStorage.removeItem(key);
|
|
57534
|
+
};
|
|
57535
|
+
var name = 'auth-keycloakRedirectExperimental';
|
|
57536
|
+
var authData = {
|
|
57537
|
+
authenticated: readFromStorage('authAuthenticated') === 'true',
|
|
57538
|
+
accountId: undefined,
|
|
57539
|
+
userEmail: undefined,
|
|
57540
|
+
username: undefined,
|
|
57541
|
+
userId: undefined,
|
|
57542
|
+
roles: []
|
|
57543
|
+
};
|
|
57544
|
+
var config = null;
|
|
57545
|
+
var msalApp = null;
|
|
57546
|
+
var setConfig = /*#__PURE__*/function () {
|
|
57547
|
+
var _ref = _asyncToGenerator(function* (newConfig) {
|
|
57548
|
+
config = newConfig;
|
|
57549
|
+
msalApp = new PublicClientApplication(config.msalConfig);
|
|
57550
|
+
yield msalApp.initialize();
|
|
57551
|
+
//
|
|
57552
|
+
// if (await isUserSignedIn()) {
|
|
57553
|
+
// console.log('already signed in!');
|
|
57554
|
+
// }
|
|
57555
|
+
});
|
|
57556
|
+
return function setConfig(_x) {
|
|
57557
|
+
return _ref.apply(this, arguments);
|
|
57558
|
+
};
|
|
57559
|
+
}();
|
|
57560
|
+
var checkInit = () => {
|
|
57561
|
+
if (msalApp === null) {
|
|
57562
|
+
console.error('AuthMSAL module has not been initialized. Make sure you ' + 'call the setConfig const when = you add the AuthMSAL provider.');
|
|
57563
|
+
return false;
|
|
57564
|
+
}
|
|
57565
|
+
return true;
|
|
57566
|
+
};
|
|
57567
|
+
var redirectOnAuthSuccess = () => {
|
|
57568
|
+
var _config$msalConfig$au, _config;
|
|
57569
|
+
window.location.href = (_config$msalConfig$au = (_config = config) === null || _config === void 0 || (_config = _config.msalConfig) === null || _config === void 0 || (_config = _config.auth) === null || _config === void 0 ? void 0 : _config.redirectUri) !== null && _config$msalConfig$au !== void 0 ? _config$msalConfig$au : '/';
|
|
57570
|
+
};
|
|
57571
|
+
var _acquireTokensByRequestAndAccount = /*#__PURE__*/function () {
|
|
57572
|
+
var _ref2 = _asyncToGenerator(function* (tokenReq, account) {
|
|
57573
|
+
if (!tokenReq) {
|
|
57574
|
+
console.warn('No base access token request provided');
|
|
57575
|
+
tokenReq = {};
|
|
57576
|
+
}
|
|
57577
|
+
tokenReq.account = account;
|
|
57578
|
+
return yield msalApp.acquireTokenSilent(tokenReq).then(tokenRes => tokenRes).catch(silentTokenFetchError => {
|
|
57579
|
+
var _silentTokenFetchErro;
|
|
57580
|
+
if (silentTokenFetchError.errorCode === 'no_tokens_found') {
|
|
57581
|
+
// No token found during acquireTokenSilent, ignore this error, nothing to do
|
|
57582
|
+
return;
|
|
57583
|
+
} else if (silentTokenFetchError.errorCode === 'login_required') {
|
|
57584
|
+
console.warn('Silent authentication not possible, user is not logged in. This usually happens when the user session ' + 'has expired. Please try to log in again.');
|
|
57585
|
+
return;
|
|
57586
|
+
} else if (((_silentTokenFetchErro = silentTokenFetchError.errorMessage) === null || _silentTokenFetchErro === void 0 ? void 0 : _silentTokenFetchErro.indexOf('interaction_required')) !== -1) {
|
|
57587
|
+
msalApp.acquireTokenRedirect(tokenReq).then(tokenRes => tokenRes) // Token acquired with interaction
|
|
57588
|
+
.catch(tokenRedirectError => tokenRedirectError); // Token retrieval failed
|
|
57589
|
+
}
|
|
57590
|
+
throw silentTokenFetchError;
|
|
57591
|
+
});
|
|
57592
|
+
});
|
|
57593
|
+
return function _acquireTokensByRequestAndAccount(_x2, _x3) {
|
|
57594
|
+
return _ref2.apply(this, arguments);
|
|
57595
|
+
};
|
|
57596
|
+
}();
|
|
57597
|
+
var acquireTokens = /*#__PURE__*/function () {
|
|
57598
|
+
var _ref3 = _asyncToGenerator(function* () {
|
|
57599
|
+
var _msalApp$getAllAccoun;
|
|
57600
|
+
if (!checkInit()) return;
|
|
57601
|
+
var idToken = readFromStorage('authIdToken');
|
|
57602
|
+
var accessToken = readFromStorage('authAccessToken');
|
|
57603
|
+
var authenticated = readFromStorage('authAuthenticated') === 'true';
|
|
57604
|
+
if (authenticated && idToken != null && accessToken != null) {
|
|
57605
|
+
return {
|
|
57606
|
+
accessToken,
|
|
57607
|
+
idToken
|
|
57608
|
+
};
|
|
57609
|
+
}
|
|
57610
|
+
var account = (_msalApp$getAllAccoun = msalApp.getAllAccounts()) === null || _msalApp$getAllAccoun === void 0 ? void 0 : _msalApp$getAllAccoun[0];
|
|
57611
|
+
var tokenReq = config.accessRequest;
|
|
57612
|
+
if (account === undefined) {
|
|
57613
|
+
return undefined;
|
|
57614
|
+
}
|
|
57615
|
+
return yield _acquireTokensByRequestAndAccount(tokenReq, account);
|
|
57616
|
+
});
|
|
57617
|
+
return function acquireTokens() {
|
|
57618
|
+
return _ref3.apply(this, arguments);
|
|
57619
|
+
};
|
|
57620
|
+
}();
|
|
57621
|
+
var acquireTokensByRequest = /*#__PURE__*/function () {
|
|
57622
|
+
var _ref4 = _asyncToGenerator(function* (tokenReq) {
|
|
57623
|
+
var _msalApp$getAllAccoun2;
|
|
57624
|
+
if (!checkInit()) return;
|
|
57625
|
+
var account = (_msalApp$getAllAccoun2 = msalApp.getAllAccounts()) === null || _msalApp$getAllAccoun2 === void 0 ? void 0 : _msalApp$getAllAccoun2[0];
|
|
57626
|
+
return yield _acquireTokensByRequestAndAccount(tokenReq, account);
|
|
57627
|
+
});
|
|
57628
|
+
return function acquireTokensByRequest(_x4) {
|
|
57629
|
+
return _ref4.apply(this, arguments);
|
|
57630
|
+
};
|
|
57631
|
+
}();
|
|
57632
|
+
var handleResponse = response => {
|
|
57633
|
+
if (response !== null) {
|
|
57634
|
+
response.account.homeAccountId;
|
|
57635
|
+
writeToStorage('authIdTokenPopup', response.idToken);
|
|
57636
|
+
writeToStorage('authIdToken', response.idToken);
|
|
57637
|
+
writeToStorage('authAccessToken', response.accessToken);
|
|
57638
|
+
writeToStorage('authAuthenticated', 'true');
|
|
57639
|
+
authData.authenticated = true;
|
|
57640
|
+
var account = response.account;
|
|
57641
|
+
authData.accountId = account.homeAccountId;
|
|
57642
|
+
authData.userEmail = account.username; // In MSAL account data, username property contains user email
|
|
57643
|
+
authData.username = account.name;
|
|
57644
|
+
authData.userId = account.localAccountId;
|
|
57645
|
+
redirectOnAuthSuccess();
|
|
57646
|
+
return;
|
|
57647
|
+
}
|
|
57648
|
+
|
|
57649
|
+
// In case multiple accounts exist, you can select
|
|
57650
|
+
var currentAccounts = msalApp.getAllAccounts();
|
|
57651
|
+
if (currentAccounts.length === 0) {
|
|
57652
|
+
// no accounts signed-in, attempt to sign a user in
|
|
57653
|
+
msalApp.loginRedirect(config.loginRequest);
|
|
57654
|
+
} else if (currentAccounts.length > 1) ; else if (currentAccounts.length === 1) {
|
|
57655
|
+
currentAccounts[0].homeAccountId;
|
|
57656
|
+
}
|
|
57657
|
+
};
|
|
57658
|
+
var signIn = /*#__PURE__*/function () {
|
|
57659
|
+
var _ref5 = _asyncToGenerator(function* () {
|
|
57660
|
+
if (!checkInit()) return;
|
|
57661
|
+
|
|
57662
|
+
// Force removal of MSAL interaction status if it exists in session storage (it happens sometimes after logout)
|
|
57663
|
+
// const itemKey = 'msal.interaction.status';
|
|
57664
|
+
// if (sessionStorage.getItem(itemKey)) {
|
|
57665
|
+
// sessionStorage.removeItem(itemKey);
|
|
57666
|
+
// }
|
|
57667
|
+
|
|
57668
|
+
msalApp.handleRedirectPromise().then(handleResponse);
|
|
57669
|
+
});
|
|
57670
|
+
return function signIn() {
|
|
57671
|
+
return _ref5.apply(this, arguments);
|
|
57672
|
+
};
|
|
57673
|
+
}();
|
|
57428
57674
|
var signOut = () => {
|
|
57429
57675
|
if (!checkInit()) return;
|
|
57430
57676
|
clearFromStorage('authIdTokenPopup');
|
|
@@ -57438,7 +57684,7 @@ var signOut = () => {
|
|
|
57438
57684
|
msalApp.logoutRedirect(logoutRequest);
|
|
57439
57685
|
};
|
|
57440
57686
|
|
|
57441
|
-
// Returns a boolean value, stating whether the isUserSignedIn must be provided a callback
|
|
57687
|
+
// Returns a boolean value, stating whether the isUserSignedIn must be provided a callback
|
|
57442
57688
|
var isAsync = () => {
|
|
57443
57689
|
return false;
|
|
57444
57690
|
};
|
|
@@ -57453,7 +57699,7 @@ var _extractRolesFromAccessToken = accessToken => {
|
|
|
57453
57699
|
return result;
|
|
57454
57700
|
};
|
|
57455
57701
|
var isUserSignedIn = /*#__PURE__*/function () {
|
|
57456
|
-
var
|
|
57702
|
+
var _ref6 = _asyncToGenerator(function* () {
|
|
57457
57703
|
// Return true if already authenticated
|
|
57458
57704
|
if (authData.authenticated) return true;
|
|
57459
57705
|
if (readFromStorage('authAuthenticated') === 'true') {
|
|
@@ -57475,7 +57721,7 @@ var isUserSignedIn = /*#__PURE__*/function () {
|
|
|
57475
57721
|
return false;
|
|
57476
57722
|
});
|
|
57477
57723
|
return function isUserSignedIn() {
|
|
57478
|
-
return
|
|
57724
|
+
return _ref6.apply(this, arguments);
|
|
57479
57725
|
};
|
|
57480
57726
|
}();
|
|
57481
57727
|
var getUserEmail = () => {
|
|
@@ -57502,7 +57748,7 @@ var getUserPicUrl = () => {
|
|
|
57502
57748
|
return undefined;
|
|
57503
57749
|
};
|
|
57504
57750
|
|
|
57505
|
-
var
|
|
57751
|
+
var AuthKeycloakRedirectExperimental = /*#__PURE__*/Object.freeze({
|
|
57506
57752
|
__proto__: null,
|
|
57507
57753
|
acquireTokens: acquireTokens,
|
|
57508
57754
|
acquireTokensByRequest: acquireTokensByRequest,
|
|
@@ -57864,4 +58110,4 @@ var ResourceUtils = {
|
|
|
57864
58110
|
getFirstRootResource
|
|
57865
58111
|
};
|
|
57866
58112
|
|
|
57867
|
-
export { AgGridUtils, Auth, AuthDev,
|
|
58113
|
+
export { AgGridUtils, Auth, AuthDev, AuthKeycloakPopupExperimental, AuthKeycloakRedirectExperimental, CSVUtils, DatasetUtils, DateUtils, Error$1 as Error, FileBlobUtils, PathUtils, ResourceUtils, ScenarioUtils, ValidationUtils, XLSXUtils };
|