@xh/hoist 78.1.1 → 78.1.3
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/CHANGELOG.md +1 -1
- package/build/types/core/XH.d.ts +9 -4
- package/build/types/security/msal/MsalClient.d.ts +1 -1
- package/core/XH.ts +12 -4
- package/package.json +1 -1
- package/security/msal/MsalClient.ts +22 -29
- package/tsconfig.tsbuildinfo +1 -1
- package/utils/js/LogUtils.ts +5 -5
package/CHANGELOG.md
CHANGED
package/build/types/core/XH.d.ts
CHANGED
|
@@ -185,12 +185,17 @@ export declare class XHApi {
|
|
|
185
185
|
*/
|
|
186
186
|
get logLevel(): LogLevel;
|
|
187
187
|
/**
|
|
188
|
-
* Set the minimum severity for Hoist log utils
|
|
189
|
-
* this adjustment for up to 1440 minutes in local storage.
|
|
190
|
-
*
|
|
191
|
-
* Hint: call this method from the console to adjust your app's log level while troubleshooting.
|
|
188
|
+
* Set the minimum severity for Hoist log utils.
|
|
189
|
+
* Optionally persist this adjustment for up to 1440 minutes in local storage.
|
|
192
190
|
*/
|
|
193
191
|
setLogLevel(level: LogLevel, persistMins?: number): void;
|
|
192
|
+
/**
|
|
193
|
+
* Short cut to enable client-side logging at level `debug`.
|
|
194
|
+
* Optionally persist this adjustment for up to 1440 minutes in local storage.
|
|
195
|
+
*
|
|
196
|
+
* Hint: call this method from the console to show more verbose data while troubleshooting.
|
|
197
|
+
*/
|
|
198
|
+
enableDebugLogging(persistMins?: number): void;
|
|
194
199
|
/**
|
|
195
200
|
* Main entry point to start the client app - initializes and renders application code.
|
|
196
201
|
* Call from the app's entry-point file within your project's `/client-app/src/apps/` folder.
|
|
@@ -49,7 +49,7 @@ export interface MsalClientConfig extends BaseOAuthClientConfig<MsalTokenSpec> {
|
|
|
49
49
|
*
|
|
50
50
|
* In practice, and according to documentation, this operation is likely to fail for a
|
|
51
51
|
* number of reasons, and can often do so as timeout. Therefore, keeping the timeout limit
|
|
52
|
-
* value -- `system.
|
|
52
|
+
* value -- `system.iframeHashTimeout` -- at a relatively low value is critical. Hoist
|
|
53
53
|
* defaults this value to 3000ms vs. the default 10000ms.
|
|
54
54
|
*/
|
|
55
55
|
enableSsoSilent?: boolean;
|
package/core/XH.ts
CHANGED
|
@@ -370,15 +370,23 @@ export class XHApi {
|
|
|
370
370
|
}
|
|
371
371
|
|
|
372
372
|
/**
|
|
373
|
-
* Set the minimum severity for Hoist log utils
|
|
374
|
-
* this adjustment for up to 1440 minutes in local storage.
|
|
375
|
-
*
|
|
376
|
-
* Hint: call this method from the console to adjust your app's log level while troubleshooting.
|
|
373
|
+
* Set the minimum severity for Hoist log utils.
|
|
374
|
+
* Optionally persist this adjustment for up to 1440 minutes in local storage.
|
|
377
375
|
*/
|
|
378
376
|
setLogLevel(level: LogLevel, persistMins: number = -1) {
|
|
379
377
|
setLogLevel(level, persistMins);
|
|
380
378
|
}
|
|
381
379
|
|
|
380
|
+
/**
|
|
381
|
+
* Short cut to enable client-side logging at level `debug`.
|
|
382
|
+
* Optionally persist this adjustment for up to 1440 minutes in local storage.
|
|
383
|
+
*
|
|
384
|
+
* Hint: call this method from the console to show more verbose data while troubleshooting.
|
|
385
|
+
*/
|
|
386
|
+
enableDebugLogging(persistMins: number = -1) {
|
|
387
|
+
setLogLevel('debug', persistMins);
|
|
388
|
+
}
|
|
389
|
+
|
|
382
390
|
//----------------------
|
|
383
391
|
// App lifecycle support
|
|
384
392
|
//----------------------
|
package/package.json
CHANGED
|
@@ -72,7 +72,7 @@ export interface MsalClientConfig extends BaseOAuthClientConfig<MsalTokenSpec> {
|
|
|
72
72
|
*
|
|
73
73
|
* In practice, and according to documentation, this operation is likely to fail for a
|
|
74
74
|
* number of reasons, and can often do so as timeout. Therefore, keeping the timeout limit
|
|
75
|
-
* value -- `system.
|
|
75
|
+
* value -- `system.iframeHashTimeout` -- at a relatively low value is critical. Hoist
|
|
76
76
|
* defaults this value to 3000ms vs. the default 10000ms.
|
|
77
77
|
*/
|
|
78
78
|
enableSsoSilent?: boolean;
|
|
@@ -385,37 +385,30 @@ export class MsalClient extends BaseOAuthClient<MsalClientConfig, MsalTokenSpec>
|
|
|
385
385
|
const {clientId, authority, msalLogLevel, msalClientOptions, enableTelemetry} = this.config;
|
|
386
386
|
throwIf(!authority, 'Missing MSAL authority. Please review your configuration.');
|
|
387
387
|
|
|
388
|
-
|
|
389
|
-
{
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
logLevel: msalLogLevel
|
|
399
|
-
},
|
|
400
|
-
iFrameHashTimeout: 3000 // Prevent long pauses for sso failures.
|
|
388
|
+
let conf: Configuration = {
|
|
389
|
+
auth: {
|
|
390
|
+
clientId,
|
|
391
|
+
authority,
|
|
392
|
+
postLogoutRedirectUri: this.postLogoutRedirectUrl
|
|
393
|
+
},
|
|
394
|
+
system: {
|
|
395
|
+
loggerOptions: {
|
|
396
|
+
loggerCallback: this.logFromMsal,
|
|
397
|
+
logLevel: msalLogLevel
|
|
401
398
|
},
|
|
402
|
-
|
|
403
|
-
cacheLocation: 'localStorage' // allows sharing auth info across tabs.
|
|
404
|
-
}
|
|
399
|
+
iframeHashTimeout: 3000 // Prevent long pauses for sso failures.
|
|
405
400
|
},
|
|
406
|
-
|
|
407
|
-
|
|
401
|
+
cache: {
|
|
402
|
+
cacheLocation: 'localStorage' // allows sharing auth info across tabs.
|
|
403
|
+
}
|
|
404
|
+
};
|
|
408
405
|
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
}
|
|
416
|
-
}
|
|
417
|
-
: mergedConf
|
|
418
|
-
);
|
|
406
|
+
conf = mergeDeep(conf, msalClientOptions);
|
|
407
|
+
if (enableTelemetry) {
|
|
408
|
+
conf.telemetry = {client: new BrowserPerformanceClient(conf)};
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
return msal.PublicClientApplication.createPublicClientApplication(conf);
|
|
419
412
|
}
|
|
420
413
|
|
|
421
414
|
private logFromMsal(level: LogLevel, message: string) {
|