@memberjunction/ng-auth-services 5.15.0 → 5.16.0
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/dist/lib/AngularAuthProviderFactory.d.ts +2 -2
- package/dist/lib/AngularAuthProviderFactory.d.ts.map +1 -1
- package/dist/lib/AngularAuthProviderFactory.js +11 -6
- package/dist/lib/AngularAuthProviderFactory.js.map +1 -1
- package/dist/lib/redirect.component.d.ts +3 -2
- package/dist/lib/redirect.component.d.ts.map +1 -1
- package/dist/lib/redirect.component.js +11 -6
- package/dist/lib/redirect.component.js.map +1 -1
- package/package.json +3 -3
|
@@ -7,14 +7,14 @@ import * as i0 from "@angular/core";
|
|
|
7
7
|
*/
|
|
8
8
|
export declare class AngularAuthProviderFactory {
|
|
9
9
|
private injector;
|
|
10
|
-
private static
|
|
10
|
+
private static readonly _globalStoreKey;
|
|
11
11
|
private providers;
|
|
12
12
|
private providerConfigs;
|
|
13
13
|
constructor(injector: Injector);
|
|
14
14
|
/**
|
|
15
15
|
* Get singleton instance
|
|
16
16
|
*/
|
|
17
|
-
static
|
|
17
|
+
static get Instance(): AngularAuthProviderFactory;
|
|
18
18
|
/**
|
|
19
19
|
* Create a provider based on configuration
|
|
20
20
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AngularAuthProviderFactory.d.ts","sourceRoot":"","sources":["../../src/lib/AngularAuthProviderFactory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,QAAQ,EAAE,MAAM,eAAe,CAAC;AAGrD,OAAO,EAAE,oBAAoB,EAAE,yBAAyB,EAAE,MAAM,iBAAiB,CAAC;;AAElF;;;GAGG;AACH,qBAGa,0BAA0B;IAKzB,OAAO,CAAC,QAAQ;IAJ5B,OAAO,CAAC,MAAM,CAAC,QAAQ,
|
|
1
|
+
{"version":3,"file":"AngularAuthProviderFactory.d.ts","sourceRoot":"","sources":["../../src/lib/AngularAuthProviderFactory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,QAAQ,EAAE,MAAM,eAAe,CAAC;AAGrD,OAAO,EAAE,oBAAoB,EAAE,yBAAyB,EAAE,MAAM,iBAAiB,CAAC;;AAElF;;;GAGG;AACH,qBAGa,0BAA0B;IAKzB,OAAO,CAAC,QAAQ;IAJ5B,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,eAAe,CAA8C;IACrF,OAAO,CAAC,SAAS,CAAgD;IACjE,OAAO,CAAC,eAAe,CAA+B;gBAElC,QAAQ,EAAE,QAAQ;IAQtC;;OAEG;IACH,WAAkB,QAAQ,IAAI,0BAA0B,CAMvD;IAED;;OAEG;IACH,cAAc,CAAC,MAAM,EAAE,yBAAyB,GAAG,oBAAoB;IAoCvE;;OAEG;IACH,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,oBAAoB,GAAG,SAAS;IAI3D;;OAEG;IACH,kBAAkB,IAAI,MAAM,EAAE;IAO9B;;OAEG;IACH,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAIvC;;OAEG;IACH,cAAc,IAAI,IAAI;IAKtB;;;OAGG;IACH,MAAM,CAAC,0BAA0B,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,GAAG,GAAG,GAAG,EAAE;yCAnG7D,0BAA0B;6CAA1B,0BAA0B;CAoItC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Injectable } from '@angular/core';
|
|
2
|
-
import { MJGlobal } from '@memberjunction/global';
|
|
2
|
+
import { MJGlobal, GetGlobalObjectStore } from '@memberjunction/global';
|
|
3
3
|
import { MJAuthBase } from './mjexplorer-auth-base.service';
|
|
4
4
|
import * as i0 from "@angular/core";
|
|
5
5
|
/**
|
|
@@ -8,21 +8,26 @@ import * as i0 from "@angular/core";
|
|
|
8
8
|
*/
|
|
9
9
|
export class AngularAuthProviderFactory {
|
|
10
10
|
injector;
|
|
11
|
-
static
|
|
11
|
+
static _globalStoreKey = '___SINGLETON__AngularAuthProviderFactory';
|
|
12
12
|
providers = new Map();
|
|
13
13
|
providerConfigs = new Map();
|
|
14
14
|
constructor(injector) {
|
|
15
15
|
this.injector = injector;
|
|
16
|
-
|
|
16
|
+
const g = GetGlobalObjectStore();
|
|
17
|
+
if (g[AngularAuthProviderFactory._globalStoreKey]) {
|
|
18
|
+
return g[AngularAuthProviderFactory._globalStoreKey];
|
|
19
|
+
}
|
|
20
|
+
g[AngularAuthProviderFactory._globalStoreKey] = this;
|
|
17
21
|
}
|
|
18
22
|
/**
|
|
19
23
|
* Get singleton instance
|
|
20
24
|
*/
|
|
21
|
-
static
|
|
22
|
-
|
|
25
|
+
static get Instance() {
|
|
26
|
+
const instance = GetGlobalObjectStore()[AngularAuthProviderFactory._globalStoreKey];
|
|
27
|
+
if (!instance) {
|
|
23
28
|
throw new Error('AngularAuthProviderFactory not initialized. Ensure it is provided in your module.');
|
|
24
29
|
}
|
|
25
|
-
return
|
|
30
|
+
return instance;
|
|
26
31
|
}
|
|
27
32
|
/**
|
|
28
33
|
* Create a provider based on configuration
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AngularAuthProviderFactory.js","sourceRoot":"","sources":["../../src/lib/AngularAuthProviderFactory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAY,MAAM,eAAe,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"AngularAuthProviderFactory.js","sourceRoot":"","sources":["../../src/lib/AngularAuthProviderFactory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAY,MAAM,eAAe,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AACxE,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;;AAG5D;;;GAGG;AAIH,MAAM,OAAO,0BAA0B;IAKjB;IAJZ,MAAM,CAAU,eAAe,GAAG,0CAA0C,CAA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AAC,KAAK,EAAE,CAAC;QACvB,IAAI,CAAC,eAAe,CAAC,KAAK,EAAE,CAAC;IAC/B,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,0BAA0B,CAAC,IAAY,EAAE,WAAgB;QAE9D,MAAM,cAAc,GAAG,IAAI,EAAE,WAAW,EAAE,CAAC;QAE3C,+CAA+C;QAC/C,MAAM,YAAY,GAAG,QAAQ,CAAC,QAAQ,CAAC,YAAY,CAAC,eAAe,CACjE,UAAU,EACV,cAAc,CACf,CAAC;QACF,MAAM,aAAa,GAAG,YAAY,EAAE,QAAe,CAAC;QAEpD,IAAI,CAAC,aAAa,EAAE,CAAC;YACnB,OAAO,CAAC,IAAI,CAAC,0CAA0C,IAAI,EAAE,CAAC,CAAC;YAC/D,OAAO,EAAE,CAAC;QACZ,CAAC;QAED,qEAAqE;QACrE,IAAI,aAAa,CAAC,sBAAsB,EAAE,CAAC;YACzC,0DAA0D;YAC1D,MAAM,QAAQ,GAAG,aAAa,CAAC,sBAAsB,CAAC,WAAW,CAAC,CAAC;YACnE,OAAO,QAAQ,CAAC;QAClB,CAAC;QACD,yDAAyD;aACpD,IAAI,OAAO,aAAa,CAAC,2BAA2B,KAAK,UAAU,EAAE,CAAC;YACzE,OAAO,CAAC,IAAI,CAAC,YAAY,IAAI,4GAA4G,CAAC,CAAC;YAC3I,OAAO,aAAa,CAAC,2BAA2B,CAAC,WAAW,CAAC,CAAC;QAChE,CAAC;aACI,CAAC;YACJ,yEAAyE;YACzE,OAAO,EAAE,CAAC;QACZ,CAAC;IACH,CAAC;oHAlIU,0BAA0B;gEAA1B,0BAA0B,WAA1B,0BAA0B,mBAFzB,MAAM;;iFAEP,0BAA0B;cAHtC,UAAU;eAAC;gBACV,UAAU,EAAE,MAAM;aACnB","sourcesContent":["import { Injectable, Injector } from '@angular/core';\nimport { MJGlobal, GetGlobalObjectStore } from '@memberjunction/global';\nimport { MJAuthBase } from './mjexplorer-auth-base.service';\nimport { IAngularAuthProvider, AngularAuthProviderConfig } from './IAuthProvider';\n\n/**\n * Factory for creating Angular authentication providers\n * Uses MJGlobal ClassFactory pattern for extensibility\n */\n@Injectable({\n providedIn: 'root'\n})\nexport class AngularAuthProviderFactory {\n private static readonly _globalStoreKey = '___SINGLETON__AngularAuthProviderFactory';\n private providers: Map<string, IAngularAuthProvider> = new Map();\n private providerConfigs: Map<string, any> = new Map();\n\n constructor(private injector: Injector) {\n const g = GetGlobalObjectStore()!;\n if (g[AngularAuthProviderFactory._globalStoreKey]) {\n return g[AngularAuthProviderFactory._globalStoreKey] as AngularAuthProviderFactory;\n }\n g[AngularAuthProviderFactory._globalStoreKey] = this;\n }\n\n /**\n * Get singleton instance\n */\n public static get Instance(): AngularAuthProviderFactory {\n const instance = GetGlobalObjectStore()![AngularAuthProviderFactory._globalStoreKey] as AngularAuthProviderFactory;\n if (!instance) {\n throw new Error('AngularAuthProviderFactory not initialized. Ensure it is provided in your module.');\n }\n return instance;\n }\n\n /**\n * Create a provider based on configuration\n */\n createProvider(config: AngularAuthProviderConfig): IAngularAuthProvider {\n \n const existingProvider = this.providers.get(config.type);\n if (existingProvider) {\n return existingProvider;\n }\n\n try {\n // Use MJGlobal ClassFactory to create the provider instance\n // Pass config as the first constructor argument\n const provider = MJGlobal.Instance.ClassFactory.CreateInstance<MJAuthBase>(\n MJAuthBase, \n config.type,\n config // Pass config as constructor argument, not injector\n );\n\n if (!provider) {\n throw new Error(`No provider registered for type: ${config.type}. Available types: ${this.getRegisteredTypes().join(', ')}`);\n }\n\n // Validate the configuration\n if (!provider.validateConfig(config)) {\n throw new Error(`Invalid configuration for provider type: ${config.type}`);\n }\n\n // Store the provider instance\n this.providers.set(config.type, provider);\n this.providerConfigs.set(config.type, config);\n\n return provider;\n } catch (error) {\n console.error(`Failed to create auth provider for type ${config.type}:`, error);\n throw error;\n }\n }\n\n /**\n * Get a provider by type\n */\n getProvider(type: string): IAngularAuthProvider | undefined {\n return this.providers.get(type);\n }\n\n /**\n * Get all registered provider types\n */\n getRegisteredTypes(): string[] {\n const registrations = MJGlobal.Instance.ClassFactory.GetRegistrationsByRootClass(MJAuthBase);\n const types = registrations.map(reg => reg.Key).filter((key): key is string => key !== null);\n // Return unique types only, as multiple classes can be registered with the same key\n return [...new Set(types)];\n }\n\n /**\n * Check if a provider type is registered\n */\n isTypeRegistered(type: string): boolean {\n return this.getRegisteredTypes().includes(type);\n }\n\n /**\n * Clear all providers (useful for testing)\n */\n clearProviders(): void {\n this.providers.clear();\n this.providerConfigs.clear();\n }\n\n /**\n * Get provider-specific Angular services that need to be injected\n * This uses the static angularProviderFactory property on each provider class for extensibility\n */\n static getProviderAngularServices(type: string, environment: any): any[] {\n \n const normalizedType = type?.toLowerCase();\n \n // Get the provider class from the ClassFactory\n const registration = MJGlobal.Instance.ClassFactory.GetRegistration(\n MJAuthBase, \n normalizedType\n );\n const providerClass = registration?.SubClass as any;\n \n if (!providerClass) {\n console.warn(`No provider class registered for type: ${type}`);\n return [];\n }\n \n // Check if the provider class has the factory property (new pattern)\n if (providerClass.angularProviderFactory) {\n // Call the factory function to get the required providers\n const services = providerClass.angularProviderFactory(environment);\n return services;\n } \n // Fallback to old method name for backward compatibility\n else if (typeof providerClass.getRequiredAngularProviders === 'function') {\n console.warn(`Provider ${type} uses deprecated getRequiredAngularProviders method. Please update to use angularProviderFactory property.`);\n return providerClass.getRequiredAngularProviders(environment);\n } \n else {\n // Provider doesn't define required Angular services (might not need any)\n return [];\n }\n }\n\n}"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { OnInit } from '@angular/core';
|
|
1
|
+
import { OnInit, ChangeDetectorRef } from '@angular/core';
|
|
2
2
|
import { MJAuthBase } from './mjexplorer-auth-base.service';
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
4
|
/**
|
|
@@ -7,8 +7,9 @@ import * as i0 from "@angular/core";
|
|
|
7
7
|
*/
|
|
8
8
|
export declare class RedirectComponent implements OnInit {
|
|
9
9
|
private authService;
|
|
10
|
+
private cdr;
|
|
10
11
|
isProcessing: boolean;
|
|
11
|
-
constructor(authService: MJAuthBase);
|
|
12
|
+
constructor(authService: MJAuthBase, cdr: ChangeDetectorRef);
|
|
12
13
|
ngOnInit(): Promise<void>;
|
|
13
14
|
static ɵfac: i0.ɵɵFactoryDeclaration<RedirectComponent, never>;
|
|
14
15
|
static ɵcmp: i0.ɵɵComponentDeclaration<RedirectComponent, "app-redirect", never, {}, {}, never, never, false, never>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"redirect.component.d.ts","sourceRoot":"","sources":["../../src/lib/redirect.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,MAAM,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"redirect.component.d.ts","sourceRoot":"","sources":["../../src/lib/redirect.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,MAAM,EAA2B,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAC9F,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;;AAE5D;;;GAGG;AACH,qBAea,iBAAkB,YAAW,MAAM;IAI5C,OAAO,CAAC,WAAW;IACnB,OAAO,CAAC,GAAG;IAJb,YAAY,UAAS;gBAGX,WAAW,EAAE,UAAU,EACvB,GAAG,EAAE,iBAAiB;IAG1B,QAAQ;yCARH,iBAAiB;2CAAjB,iBAAiB;CAoC7B"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Component } from '@angular/core';
|
|
1
|
+
import { Component, ChangeDetectionStrategy } from '@angular/core';
|
|
2
2
|
import * as i0 from "@angular/core";
|
|
3
3
|
import * as i1 from "./mjexplorer-auth-base.service";
|
|
4
4
|
function RedirectComponent_Conditional_0_Template(rf, ctx) { if (rf & 1) {
|
|
@@ -15,9 +15,11 @@ function RedirectComponent_Conditional_0_Template(rf, ctx) { if (rf & 1) {
|
|
|
15
15
|
*/
|
|
16
16
|
export class RedirectComponent {
|
|
17
17
|
authService;
|
|
18
|
+
cdr;
|
|
18
19
|
isProcessing = false;
|
|
19
|
-
constructor(authService) {
|
|
20
|
+
constructor(authService, cdr) {
|
|
20
21
|
this.authService = authService;
|
|
22
|
+
this.cdr = cdr;
|
|
21
23
|
}
|
|
22
24
|
async ngOnInit() {
|
|
23
25
|
// Only show the processing message if we're actually handling an auth redirect
|
|
@@ -32,6 +34,7 @@ export class RedirectComponent {
|
|
|
32
34
|
const isMCPOAuthCallback = window.location.pathname.startsWith('/oauth/callback');
|
|
33
35
|
if (hasAuthCode && !isMCPOAuthCallback) {
|
|
34
36
|
this.isProcessing = true;
|
|
37
|
+
this.cdr.markForCheck();
|
|
35
38
|
try {
|
|
36
39
|
// Handle the callback for the current auth provider
|
|
37
40
|
await this.authService.handleCallback();
|
|
@@ -42,21 +45,23 @@ export class RedirectComponent {
|
|
|
42
45
|
finally {
|
|
43
46
|
// Always hide the component after processing
|
|
44
47
|
this.isProcessing = false;
|
|
48
|
+
this.cdr.markForCheck();
|
|
45
49
|
}
|
|
46
50
|
}
|
|
47
51
|
}
|
|
48
|
-
static ɵfac = function RedirectComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || RedirectComponent)(i0.ɵɵdirectiveInject(i1.MJAuthBase)); };
|
|
52
|
+
static ɵfac = function RedirectComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || RedirectComponent)(i0.ɵɵdirectiveInject(i1.MJAuthBase), i0.ɵɵdirectiveInject(i0.ChangeDetectorRef)); };
|
|
49
53
|
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: RedirectComponent, selectors: [["app-redirect"]], standalone: false, decls: 1, vars: 1, consts: [[2, "display", "flex", "justify-content", "center", "align-items", "center", "height", "100vh"], [2, "text-align", "center"]], template: function RedirectComponent_Template(rf, ctx) { if (rf & 1) {
|
|
50
54
|
i0.ɵɵconditionalCreate(0, RedirectComponent_Conditional_0_Template, 6, 0, "div", 0);
|
|
51
55
|
} if (rf & 2) {
|
|
52
56
|
i0.ɵɵconditional(ctx.isProcessing ? 0 : -1);
|
|
53
|
-
} }, encapsulation: 2 });
|
|
57
|
+
} }, encapsulation: 2, changeDetection: 0 });
|
|
54
58
|
}
|
|
55
59
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(RedirectComponent, [{
|
|
56
60
|
type: Component,
|
|
57
61
|
args: [{
|
|
58
62
|
standalone: false,
|
|
59
63
|
selector: 'app-redirect',
|
|
64
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
60
65
|
template: `
|
|
61
66
|
@if (isProcessing) {
|
|
62
67
|
<div style="display: flex; justify-content: center; align-items: center; height: 100vh;">
|
|
@@ -68,6 +73,6 @@ export class RedirectComponent {
|
|
|
68
73
|
}
|
|
69
74
|
`
|
|
70
75
|
}]
|
|
71
|
-
}], () => [{ type: i1.MJAuthBase }], null); })();
|
|
72
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(RedirectComponent, { className: "RedirectComponent", filePath: "src/lib/redirect.component.ts", lineNumber:
|
|
76
|
+
}], () => [{ type: i1.MJAuthBase }, { type: i0.ChangeDetectorRef }], null); })();
|
|
77
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(RedirectComponent, { className: "RedirectComponent", filePath: "src/lib/redirect.component.ts", lineNumber: 23 }); })();
|
|
73
78
|
//# sourceMappingURL=redirect.component.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"redirect.component.js","sourceRoot":"","sources":["../../src/lib/redirect.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAU,MAAM,eAAe,CAAC;;;;
|
|
1
|
+
{"version":3,"file":"redirect.component.js","sourceRoot":"","sources":["../../src/lib/redirect.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAU,uBAAuB,EAAqB,MAAM,eAAe,CAAC;;;;IAepF,AADF,AADF,8BAAyF,aACtD,SAC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GAAG,CAAC,YAAY,EAAE,CAAC;YAC1B,CAAC;QACH,CAAC;IACH,CAAC;2GAnCU,iBAAiB;6DAAjB,iBAAiB;YAV1B,mFAAoB;;YAApB,2CAOC;;;iFAGQ,iBAAiB;cAf7B,SAAS;eAAC;gBACT,UAAU,EAAE,KAAK;gBACjB,QAAQ,EAAE,cAAc;gBACxB,eAAe,EAAE,uBAAuB,CAAC,MAAM;gBAC/C,QAAQ,EAAE;;;;;;;;;KASP;aACJ;;kFACY,iBAAiB","sourcesContent":["import { Component, OnInit, ChangeDetectionStrategy, ChangeDetectorRef } from '@angular/core';\nimport { MJAuthBase } from './mjexplorer-auth-base.service';\n\n/**\n * Generic redirect component that handles OAuth callbacks for all providers\n * This replaces the MSAL-specific redirect component to work with any auth provider\n */\n@Component({\n standalone: false,\n selector: 'app-redirect',\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `\n @if (isProcessing) {\n <div style=\"display: flex; justify-content: center; align-items: center; height: 100vh;\">\n <div style=\"text-align: center;\">\n <h2>Processing authentication...</h2>\n <p>Please wait while we complete your login.</p>\n </div>\n </div>\n }\n `\n})\nexport class RedirectComponent implements OnInit {\n isProcessing = false;\n\n constructor(\n private authService: MJAuthBase,\n private cdr: ChangeDetectorRef\n ) {}\n\n async ngOnInit() {\n // Only show the processing message if we're actually handling an auth redirect\n // Check for auth codes in the URL that indicate we're in a redirect flow\n const hasAuthCode = window.location.hash.includes('code=') ||\n window.location.hash.includes('id_token=') ||\n window.location.search.includes('code=') ||\n window.location.search.includes('state=');\n\n // Don't handle MCP OAuth callbacks - those go to /oauth/callback and are handled\n // by the OAuthCallbackComponent in explorer-core. This component only handles\n // the main application auth (MSAL/Azure AD).\n const isMCPOAuthCallback = window.location.pathname.startsWith('/oauth/callback');\n\n if (hasAuthCode && !isMCPOAuthCallback) {\n this.isProcessing = true;\n this.cdr.markForCheck();\n try {\n // Handle the callback for the current auth provider\n await this.authService.handleCallback();\n } catch (error) {\n console.error('Error handling auth callback:', error);\n } finally {\n // Always hide the component after processing\n this.isProcessing = false;\n this.cdr.markForCheck();\n }\n }\n }\n}"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@memberjunction/ng-auth-services",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.16.0",
|
|
4
4
|
"description": "MemberJunction Explorer: Authentication Services",
|
|
5
5
|
"main": "./dist/public-api.js",
|
|
6
6
|
"typings": "./dist/public-api.d.ts",
|
|
@@ -30,8 +30,8 @@
|
|
|
30
30
|
"@okta/okta-auth-js": "^7.14.1"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@memberjunction/core": "5.
|
|
34
|
-
"@memberjunction/global": "5.
|
|
33
|
+
"@memberjunction/core": "5.16.0",
|
|
34
|
+
"@memberjunction/global": "5.16.0",
|
|
35
35
|
"rxjs": "^7.8.2",
|
|
36
36
|
"tslib": "^2.8.1"
|
|
37
37
|
},
|