@opensourcekd/ng-common-libs 1.2.5 → 1.2.7

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.
@@ -1,4 +1,3 @@
1
- import { HttpClient } from '@angular/common/http';
2
1
  import { ReplaySubject, Observable } from 'rxjs';
3
2
  import { EventType } from 'mitt';
4
3
 
@@ -120,15 +119,13 @@ interface UserData {
120
119
  * To enable navigation after auth operations, uncomment the marked sections in consuming components.
121
120
  */
122
121
  declare class AuthService {
123
- private http;
124
122
  private eventBus;
125
- id: string;
126
123
  private readonly STANDARD_JWT_CLAIMS;
127
124
  private auth0Client;
128
125
  private initializationPromise;
129
126
  private userSubject;
130
127
  user$: Observable<UserInfo | null>;
131
- constructor(http: HttpClient, eventBus: EventBusService);
128
+ constructor(eventBus: EventBusService);
132
129
  /**
133
130
  * Initialize Auth0 client
134
131
  */
@@ -162,6 +159,13 @@ declare class AuthService {
162
159
  success: boolean;
163
160
  appState?: any;
164
161
  }>;
162
+ /**
163
+ * Decode and log the access token to console
164
+ * NOTE: This logs sensitive token information to console for debugging purposes.
165
+ * In production environments, consider disabling this or filtering console logs.
166
+ * @param token - The JWT access token
167
+ */
168
+ private decodeAndLogToken;
165
169
  /**
166
170
  * Log all user claims for debugging
167
171
  * @param user - User info from Auth0
@@ -279,6 +283,10 @@ declare class AuthService {
279
283
  /**
280
284
  * Auth0 client configuration
281
285
  * Override these values in your consuming application by setting them before importing AuthService
286
+ *
287
+ * Note: redirectUri defaults to window.location.origin (base URL without path).
288
+ * Auth0 will redirect back to this URL after authentication.
289
+ * You can override this to a specific callback URL (e.g., '/auth-callback') using configureAuth0().
282
290
  */
283
291
  declare const AUTH0_CONFIG: {
284
292
  domain: string;
@@ -329,17 +337,29 @@ declare function setStorageItem(key: string, value: string, storageType?: 'local
329
337
  */
330
338
  declare function removeStorageItem(key: string, storageType?: 'localStorage' | 'sessionStorage'): void;
331
339
  /**
332
- * Configure Auth0 settings
333
- * Call this function in your consuming application before using AuthService
340
+ * Configure Auth0 settings (OPTIONAL)
341
+ * Call this function in your consuming application to override default Auth0 configuration.
342
+ * Only the values you provide will be overridden; all other defaults remain unchanged.
343
+ *
344
+ * Note: This function is optional. If not called, default values will be used.
345
+ *
346
+ * @param config - Partial Auth0 configuration object with values to override
334
347
  *
335
348
  * @example
336
349
  * ```typescript
337
350
  * import { configureAuth0 } from '@opensourcekd/ng-common-libs';
338
351
  *
352
+ * // Only override specific values - others keep their defaults
339
353
  * configureAuth0({
340
354
  * domain: 'your-domain.auth0.com',
341
355
  * clientId: 'your-client-id',
342
356
  * audience: 'https://your-api.com'
357
+ * // redirectUri, logoutUri, scope, etc. will use defaults
358
+ * });
359
+ *
360
+ * // Or override just redirectUri to use a specific callback page
361
+ * configureAuth0({
362
+ * redirectUri: window.location.origin + '/auth-callback'
343
363
  * });
344
364
  * ```
345
365
  */