@igo2/auth 21.0.0-next.2 → 21.0.0-next.21

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,6 +1,7 @@
1
1
  import { HttpClient, HttpHeaders, HTTP_INTERCEPTORS } from '@angular/common/http';
2
2
  import * as i0 from '@angular/core';
3
3
  import { inject, Injector, Injectable, InjectionToken, signal, makeEnvironmentProviders } from '@angular/core';
4
+ import { XHR_INTERCEPTOR } from '@igo2/core/auth';
4
5
  import { BaseStorage, StorageScope, StorageService } from '@igo2/core/storage';
5
6
  import { Router } from '@angular/router';
6
7
  import { ConfigService } from '@igo2/core/config';
@@ -20,7 +21,7 @@ class TokenService {
20
21
  constructor() {
21
22
  const config = this.injector.get(ConfigService);
22
23
  this.options = config.getConfig('auth');
23
- this.tokenKey = this.options?.tokenKey;
24
+ this.tokenKey = this.options?.tokenKey ?? '';
24
25
  }
25
26
  set(token) {
26
27
  localStorage.setItem(this.tokenKey, token);
@@ -29,7 +30,7 @@ class TokenService {
29
30
  localStorage.removeItem(this.tokenKey);
30
31
  }
31
32
  get() {
32
- return localStorage.getItem(this.tokenKey);
33
+ return localStorage.getItem(this.tokenKey) ?? undefined;
33
34
  }
34
35
  decode() {
35
36
  const token = this.get();
@@ -41,15 +42,15 @@ class TokenService {
41
42
  isExpired() {
42
43
  const jwt = this.decode();
43
44
  const currentTime = new Date().getTime() / 1000;
44
- if (jwt && currentTime < jwt.exp) {
45
+ if (jwt?.exp && currentTime < jwt.exp) {
45
46
  return false;
46
47
  }
47
48
  return true;
48
49
  }
49
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: TokenService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
50
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: TokenService, providedIn: 'root' });
50
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: TokenService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
51
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: TokenService, providedIn: 'root' });
51
52
  }
52
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: TokenService, decorators: [{
53
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: TokenService, decorators: [{
53
54
  type: Injectable,
54
55
  args: [{
55
56
  providedIn: 'root'
@@ -79,10 +80,10 @@ class UserService {
79
80
  updatePreference(preference) {
80
81
  return this.http.patch(this.baseUrl, { preference });
81
82
  }
82
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: UserService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
83
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: UserService });
83
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: UserService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
84
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: UserService });
84
85
  }
85
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: UserService, decorators: [{
86
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: UserService, decorators: [{
86
87
  type: Injectable
87
88
  }], ctorParameters: () => [] });
88
89
 
@@ -96,8 +97,8 @@ class AuthService {
96
97
  languageService = inject(LanguageService);
97
98
  messageService = inject(MessageService);
98
99
  router = inject(Router, { optional: true });
99
- authenticate$ = new BehaviorSubject(undefined);
100
- logged$ = new BehaviorSubject(undefined);
100
+ authenticate$ = new BehaviorSubject(false);
101
+ logged$ = new BehaviorSubject(false);
101
102
  redirectUrl;
102
103
  languageForce = false;
103
104
  authOptions;
@@ -153,7 +154,7 @@ class AuthService {
153
154
  logout() {
154
155
  this.logoutInternal();
155
156
  if (this.authOptions.logoutRedirectRoute) {
156
- this.router.navigate([this.authOptions.logoutRedirectRoute]);
157
+ this.router?.navigate([this.authOptions.logoutRedirectRoute]);
157
158
  }
158
159
  }
159
160
  logoutInternal() {
@@ -250,7 +251,7 @@ class AuthService {
250
251
  return of(null);
251
252
  }
252
253
  if (this.userService) {
253
- const obs$ = this.authOptions.user.withSync
254
+ const obs$ = this.authOptions.user?.withSync
254
255
  ? this.userService.sync()
255
256
  : this.userService.getUser();
256
257
  return obs$.pipe(tap$1(() => this.authenticate$.next(true)));
@@ -258,10 +259,10 @@ class AuthService {
258
259
  this.authenticate$.next(true);
259
260
  return of(null);
260
261
  }
261
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: AuthService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
262
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: AuthService, providedIn: 'root' });
262
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: AuthService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
263
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: AuthService, providedIn: 'root' });
263
264
  }
264
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: AuthService, decorators: [{
265
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: AuthService, decorators: [{
265
266
  type: Injectable,
266
267
  args: [{
267
268
  providedIn: 'root'
@@ -283,10 +284,10 @@ class AdminGuard {
283
284
  }
284
285
  return false;
285
286
  }
286
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: AdminGuard, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
287
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: AdminGuard, providedIn: 'root' });
287
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: AdminGuard, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
288
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: AdminGuard, providedIn: 'root' });
288
289
  }
289
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: AdminGuard, decorators: [{
290
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: AdminGuard, decorators: [{
290
291
  type: Injectable,
291
292
  args: [{
292
293
  providedIn: 'root'
@@ -384,10 +385,10 @@ class AuthStorageService extends BaseStorage {
384
385
  });
385
386
  }
386
387
  }
387
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: AuthStorageService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
388
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: AuthStorageService, providedIn: 'root' });
388
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: AuthStorageService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
389
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: AuthStorageService, providedIn: 'root' });
389
390
  }
390
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: AuthStorageService, decorators: [{
391
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: AuthStorageService, decorators: [{
391
392
  type: Injectable,
392
393
  args: [{
393
394
  providedIn: 'root'
@@ -409,10 +410,10 @@ class AuthGuard {
409
410
  }
410
411
  return false;
411
412
  }
412
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: AuthGuard, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
413
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: AuthGuard, providedIn: 'root' });
413
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: AuthGuard, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
414
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: AuthGuard, providedIn: 'root' });
414
415
  }
415
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: AuthGuard, decorators: [{
416
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: AuthGuard, decorators: [{
416
417
  type: Injectable,
417
418
  args: [{
418
419
  providedIn: 'root'
@@ -509,12 +510,15 @@ class AuthInterceptor {
509
510
  handleHostsWithCredentials(reqUrl) {
510
511
  let withCredentials = false;
511
512
  for (const hostWithCredentials of this.hostsWithCredentials) {
513
+ if (!hostWithCredentials.domainRegFilters) {
514
+ return;
515
+ }
512
516
  const domainRegex = new RegExp(hostWithCredentials.domainRegFilters);
513
517
  if (domainRegex.test(reqUrl)) {
514
518
  withCredentials =
515
519
  hostWithCredentials.withCredentials !== undefined
516
520
  ? hostWithCredentials.withCredentials
517
- : undefined;
521
+ : false;
518
522
  break;
519
523
  }
520
524
  }
@@ -523,6 +527,9 @@ class AuthInterceptor {
523
527
  handleHostsAuthByKey(reqUrl) {
524
528
  let hostWithKey;
525
529
  for (const hostWithAuthByKey of this.hostsWithAuthByKey) {
530
+ if (!hostWithAuthByKey.domainRegFilters) {
531
+ return;
532
+ }
526
533
  const domainRegex = new RegExp(hostWithAuthByKey.domainRegFilters);
527
534
  if (domainRegex.test(reqUrl)) {
528
535
  const replace = `${hostWithAuthByKey.keyProperty}=${hostWithAuthByKey.keyValue}`;
@@ -542,7 +549,7 @@ class AuthInterceptor {
542
549
  const jwt = this.tokenService.decode();
543
550
  const currentTime = new Date().getTime() / 1000;
544
551
  if (!this.refreshInProgress &&
545
- jwt &&
552
+ jwt?.exp &&
546
553
  currentTime < jwt.exp &&
547
554
  currentTime > jwt.exp - 1800) {
548
555
  this.refreshInProgress = true;
@@ -558,10 +565,10 @@ class AuthInterceptor {
558
565
  });
559
566
  }
560
567
  }
561
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: AuthInterceptor, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
562
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: AuthInterceptor, providedIn: 'root' });
568
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: AuthInterceptor, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
569
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: AuthInterceptor, providedIn: 'root' });
563
570
  }
564
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: AuthInterceptor, decorators: [{
571
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: AuthInterceptor, decorators: [{
565
572
  type: Injectable,
566
573
  args: [{
567
574
  providedIn: 'root'
@@ -589,10 +596,10 @@ class LoggedGuard {
589
596
  }
590
597
  return false;
591
598
  }
592
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: LoggedGuard, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
593
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: LoggedGuard, providedIn: 'root' });
599
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: LoggedGuard, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
600
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: LoggedGuard, providedIn: 'root' });
594
601
  }
595
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: LoggedGuard, decorators: [{
602
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: LoggedGuard, decorators: [{
596
603
  type: Injectable,
597
604
  args: [{
598
605
  providedIn: 'root'
@@ -608,7 +615,7 @@ class ProfilsGuard {
608
615
  const authConfig = this.config.getConfig('auth');
609
616
  if (profils &&
610
617
  profils.profils &&
611
- profils.profils.some((v) => authConfig.profilsGuard.indexOf(v) !== -1)) {
618
+ profils.profils.some((v) => authConfig.profilsGuard?.indexOf(v) !== -1)) {
612
619
  return true;
613
620
  }
614
621
  this.authService.redirectUrl = state.url;
@@ -618,10 +625,10 @@ class ProfilsGuard {
618
625
  return false;
619
626
  }));
620
627
  }
621
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: ProfilsGuard, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
622
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: ProfilsGuard, providedIn: 'root' });
628
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: ProfilsGuard, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
629
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: ProfilsGuard, providedIn: 'root' });
623
630
  }
624
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: ProfilsGuard, decorators: [{
631
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: ProfilsGuard, decorators: [{
625
632
  type: Injectable,
626
633
  args: [{
627
634
  providedIn: 'root'
@@ -658,6 +665,10 @@ function provideAuthentification(...features) {
658
665
  useClass: AuthInterceptor,
659
666
  multi: true
660
667
  },
668
+ {
669
+ provide: XHR_INTERCEPTOR,
670
+ useExisting: AuthInterceptor
671
+ },
661
672
  {
662
673
  provide: StorageService,
663
674
  useClass: AuthStorageService
@@ -1 +1 @@
1
- {"version":3,"file":"igo2-auth.mjs","sources":["../../../packages/auth/src/lib/shared/token.service.ts","../../../packages/auth/src/lib/shared/user/user.service.ts","../../../packages/auth/src/lib/shared/auth.service.ts","../../../packages/auth/src/lib/shared/admin.guard.ts","../../../packages/auth/src/lib/shared/auth-storage.service.ts","../../../packages/auth/src/lib/shared/auth.guard.ts","../../../packages/auth/src/lib/shared/auth.interceptor.ts","../../../packages/auth/src/lib/shared/auth.interface.ts","../../../packages/auth/src/lib/shared/logged.guard.ts","../../../packages/auth/src/lib/shared/profils.guard.ts","../../../packages/auth/src/lib/shared/user/user.provider.ts","../../../packages/auth/src/lib/auth.provider.ts","../../../packages/auth/src/public_api.ts","../../../packages/auth/src/igo2-auth.ts"],"sourcesContent":["import { Injectable, Injector, inject } from '@angular/core';\n\nimport { ConfigService } from '@igo2/core/config';\n\nimport { jwtDecode } from 'jwt-decode';\n\nimport { AuthOptions } from './auth.interface';\nimport { IgoJwtPayload } from './token.interface';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class TokenService {\n private injector = inject(Injector);\n\n private options?: AuthOptions;\n private tokenKey: string;\n\n constructor() {\n const config = this.injector.get<ConfigService>(ConfigService);\n this.options = config.getConfig('auth');\n this.tokenKey = this.options?.tokenKey;\n }\n\n set(token: string) {\n localStorage.setItem(this.tokenKey, token);\n }\n\n remove() {\n localStorage.removeItem(this.tokenKey);\n }\n\n get(): string {\n return localStorage.getItem(this.tokenKey);\n }\n\n decode(): IgoJwtPayload | null {\n const token = this.get();\n if (!token) {\n return;\n }\n return jwtDecode(token) satisfies IgoJwtPayload;\n }\n\n isExpired() {\n const jwt = this.decode();\n const currentTime = new Date().getTime() / 1000;\n if (jwt && currentTime < jwt.exp) {\n return false;\n }\n return true;\n }\n}\n","import { HttpClient } from '@angular/common/http';\nimport { Injectable, InjectionToken, inject } from '@angular/core';\n\nimport { BehaviorSubject, Observable, tap } from 'rxjs';\n\nimport { IAuthUserIgoOptions } from '../auth.interface';\nimport { IUser, IUserPreference } from './user.interface';\n\nexport const USER_AUTH_OPTIONS = new InjectionToken<IAuthUserIgoOptions>(\n 'USER_AUTH_OPTIONS'\n);\n\n@Injectable()\nexport class UserService {\n private http = inject(HttpClient);\n private options = inject(USER_AUTH_OPTIONS);\n\n private baseUrl: string;\n\n private _user$ = new BehaviorSubject<IUser>(undefined);\n user$ = this._user$.asObservable();\n\n constructor() {\n this.baseUrl = this.options.apiUrl;\n }\n\n getUser(): Observable<IUser> {\n return this.http\n .get<IUser>(this.baseUrl)\n .pipe(tap((user) => this._user$.next(user)));\n }\n\n sync(): Observable<IUser> {\n return this.http\n .get<IUser>(`${this.baseUrl}/sync`)\n .pipe(tap((user) => this._user$.next(user)));\n }\n\n updatePreference(preference: IUserPreference) {\n return this.http.patch<{ id: number }>(this.baseUrl, { preference });\n }\n}\n","import { HttpClient, HttpHeaders } from '@angular/common/http';\nimport { Injectable, inject, signal } from '@angular/core';\nimport { Router } from '@angular/router';\n\nimport { ConfigService } from '@igo2/core/config';\nimport { LanguageService } from '@igo2/core/language';\nimport { MessageService } from '@igo2/core/message';\nimport { Base64 } from '@igo2/utils';\n\nimport { BehaviorSubject, Observable, of } from 'rxjs';\nimport { catchError, finalize, switchMap, tap } from 'rxjs/operators';\nimport { globalCacheBusterNotifier } from 'ts-cacheable';\n\nimport { AuthOptions, IInfosUser, User } from './auth.interface';\nimport { IgoJwtPayload } from './token.interface';\nimport { TokenService } from './token.service';\nimport { IUser } from './user/user.interface';\nimport { UserService } from './user/user.service';\n\ninterface IToken {\n token: string;\n}\n\n@Injectable({\n providedIn: 'root'\n})\nexport class AuthService<T extends AuthOptions = AuthOptions> {\n private http = inject(HttpClient);\n private tokenService = inject(TokenService);\n private userService = inject(UserService, {\n optional: true\n });\n private config = inject(ConfigService);\n private languageService = inject(LanguageService);\n private messageService = inject(MessageService);\n private router = inject(Router, { optional: true });\n\n public authenticate$ = new BehaviorSubject<boolean>(undefined);\n public logged$ = new BehaviorSubject<boolean>(undefined);\n public redirectUrl: string;\n public languageForce = false;\n public authOptions: T;\n\n private anonymous = false;\n\n isLogging = signal(false);\n\n get hasAuthService() {\n return this.authOptions?.url !== undefined;\n }\n\n get user(): User | null {\n const decodedToken = this.decodeToken();\n return decodedToken?.user ? decodedToken.user : null;\n }\n\n constructor() {\n this.authOptions = this.config.getConfig('auth');\n\n this.initializeAuthentication(this.authenticated).subscribe();\n\n this.authenticate$.subscribe((authenticated) => {\n this.logged$.next(authenticated);\n globalCacheBusterNotifier.next();\n });\n }\n\n login(username: string, password: string): Observable<IUser> {\n this.isLogging.set(true);\n const myHeader = new HttpHeaders({ 'Content-Type': 'application/json' });\n\n const body = {\n username,\n password: this.encodePassword(password)\n };\n\n return this.loginCall(body, myHeader).pipe(\n finalize(() => this.isLogging.set(false))\n );\n }\n\n loginWithToken(\n token: string,\n type: string,\n infosUser?: IInfosUser,\n applicationId?: string\n ): Observable<IUser> {\n const myHeader = new HttpHeaders({ 'Content-Type': 'application/json' });\n\n const body = {\n token,\n typeConnection: type,\n infosUser,\n applicationId\n };\n\n return this.loginCall(body, myHeader);\n }\n\n loginAnonymous(): Observable<boolean> {\n this.anonymous = true;\n this.logged$.next(true);\n return of(true);\n }\n\n refresh(): Observable<IToken> {\n return this.http.post(`${this.authOptions?.url}/refresh`, {}).pipe(\n tap((data: IToken) => {\n this.tokenService.set(data.token);\n }),\n catchError((err) => {\n err.error.caught = true;\n throw err;\n })\n );\n }\n\n logout(): void {\n this.logoutInternal();\n if (this.authOptions.logoutRedirectRoute) {\n this.router.navigate([this.authOptions.logoutRedirectRoute]);\n }\n }\n\n private logoutInternal(): void {\n this.anonymous = false;\n this.tokenService.remove();\n this.authenticate$.next(false);\n }\n\n isAuthenticated(): boolean {\n return !this.tokenService.isExpired();\n }\n\n getToken(): string {\n return this.tokenService.get();\n }\n\n decodeToken(): IgoJwtPayload | null {\n if (this.isAuthenticated()) {\n return this.tokenService.decode();\n }\n return;\n }\n\n goToRedirectUrl() {\n if (!this.router) {\n return;\n }\n const redirectUrl = this.redirectUrl ?? this.authOptions.homeRoute ?? '/';\n\n this.router.navigateByUrl(redirectUrl);\n }\n\n getUserInfo(): Observable<User> {\n const url = this.authOptions?.url + '/info';\n return this.http.get<User>(url);\n }\n\n getProfils(): Observable<{ profils: string[] }> {\n return this.http.get<{ profils: string[] }>(\n `${this.authOptions?.url}/profils`\n );\n }\n\n updateUser(user: User): Observable<User> {\n return this.http.patch<User>(this.authOptions?.url, user);\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n translateError(prefix: string, error: any): Observable<string> {\n return new Observable((observer) => {\n try {\n this.languageService.translate\n .get(prefix + error.error.message)\n .subscribe((errorMsg) => {\n observer.next(errorMsg);\n observer.complete();\n });\n } catch {\n if (error.error) observer.next(error.error.message);\n observer.complete();\n }\n });\n }\n\n private encodePassword(password: string) {\n return Base64.encode(password);\n }\n\n // authenticated or anonymous\n get logged(): boolean {\n return this.authenticated || this.isAnonymous;\n }\n\n get isAnonymous(): boolean {\n return this.anonymous;\n }\n\n get authenticated(): boolean {\n return this.isAuthenticated();\n }\n\n get isAdmin(): boolean {\n const token = this.decodeToken();\n if (token?.user?.isAdmin) {\n return true;\n }\n return false;\n }\n\n protected loginCall(body, headers) {\n return this.http\n .post<IToken>(`${this.authOptions?.url}/login`, body, { headers })\n .pipe(\n tap((data) => {\n this.tokenService.set(data.token);\n const tokenDecoded = this.decodeToken();\n if (tokenDecoded?.user) {\n if (tokenDecoded.user.locale && !this.languageForce) {\n this.languageService.setLanguage(tokenDecoded.user.locale);\n }\n if (tokenDecoded.user.isExpired) {\n this.messageService.alert(\n 'igo.auth.error.intern.Password expired'\n );\n }\n }\n }),\n switchMap(() => this.initializeAuthentication(true))\n );\n }\n\n private initializeAuthentication(\n isAuthenticated: boolean\n ): Observable<IUser> {\n if (!isAuthenticated) {\n this.authenticate$.next(false);\n return of(null);\n }\n\n if (this.userService) {\n const obs$ = this.authOptions.user.withSync\n ? this.userService.sync()\n : this.userService.getUser();\n\n return obs$.pipe(tap(() => this.authenticate$.next(true)));\n }\n\n this.authenticate$.next(true);\n return of(null);\n }\n}\n","import { Injectable, inject } from '@angular/core';\nimport {\n ActivatedRouteSnapshot,\n Router,\n RouterStateSnapshot\n} from '@angular/router';\n\nimport { ConfigService } from '@igo2/core/config';\n\nimport { AuthOptions } from './auth.interface';\nimport { AuthService } from './auth.service';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class AdminGuard {\n private authService = inject(AuthService);\n private config = inject(ConfigService);\n private router = inject(Router);\n\n canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot) {\n if (this.authService.isAdmin) {\n return true;\n }\n\n this.authService.redirectUrl = state.url;\n\n const authConfig = this.config.getConfig('auth') as AuthOptions;\n if (authConfig?.loginRoute) {\n this.router.navigateByUrl(authConfig.loginRoute);\n }\n\n return false;\n }\n}\n","import { Injectable, OnDestroy, inject } from '@angular/core';\n\nimport { ConfigService } from '@igo2/core/config';\nimport { BaseStorage, StorageScope } from '@igo2/core/storage';\n\nimport { EMPTY, Subject } from 'rxjs';\nimport { debounceTime, switchMap, takeUntil } from 'rxjs/operators';\n\nimport { AuthStorageOptions } from './auth-storage.interface';\nimport { AuthService } from './auth.service';\nimport { TokenService } from './token.service';\nimport { UserService } from './user/user.service';\n\nconst DEBOUNCE_TIME = 3000; // 3 seconds;\n\n@Injectable({\n providedIn: 'root'\n})\nexport class AuthStorageService\n extends BaseStorage<AuthStorageOptions>\n implements OnDestroy\n{\n private authService = inject(AuthService);\n private userService = inject(UserService, {\n optional: true\n });\n private tokenService = inject(TokenService);\n\n private preferencesChanged$ = new Subject<void>();\n private destroy$ = new Subject<void>();\n private pendingPreferences: Record<string, unknown> = {};\n private serverPreferences: Record<string, unknown> = {};\n\n constructor() {\n const config = inject(ConfigService);\n super(config);\n\n this.authService.authenticate$\n .pipe(\n switchMap((isAuthenticated) => {\n if (isAuthenticated && this.userService) {\n return this.userService.user$;\n }\n return EMPTY;\n }),\n takeUntil(this.destroy$)\n )\n .subscribe((user) => {\n if (!user?.preference) {\n return;\n }\n\n this.serverPreferences = { ...user.preference };\n for (const key of Object.keys(user.preference)) {\n const value = user.preference[key];\n super.set(key, value);\n }\n });\n\n this.preferencesChanged$\n .pipe(\n debounceTime(DEBOUNCE_TIME), // Wait for more changes to accumulate\n takeUntil(this.destroy$)\n )\n .subscribe(() => {\n this.syncPreferences();\n });\n }\n\n ngOnDestroy() {\n this.destroy$.next();\n this.destroy$.complete();\n this.preferencesChanged$.complete();\n }\n\n set(\n key: string,\n value: string | object | boolean | number,\n scope: StorageScope = StorageScope.LOCAL\n ) {\n if (scope === StorageScope.LOCAL && this.authService.authenticated) {\n this.pendingPreferences[key] = value;\n this.preferencesChanged$.next();\n }\n super.set(key, value, scope);\n }\n\n remove(key: string, scope: StorageScope = StorageScope.LOCAL) {\n if (scope === StorageScope.LOCAL && this.authService.authenticated) {\n this.pendingPreferences[key] = undefined;\n this.preferencesChanged$.next();\n }\n super.remove(key, scope);\n }\n\n clear(scope: StorageScope = StorageScope.LOCAL) {\n if (scope === StorageScope.LOCAL && this.authService.authenticated) {\n this.pendingPreferences = {};\n this.preferencesChanged$.next();\n }\n\n let token: string;\n if (scope === StorageScope.LOCAL) {\n token = this.tokenService.get();\n }\n\n super.clear(scope);\n\n if (token) {\n this.tokenService.set(token);\n }\n }\n\n private syncPreferences() {\n if (Object.keys(this.pendingPreferences).length === 0) {\n return;\n }\n\n // Filter out preferences that haven't actually changed\n const changedPreferences: Record<string, unknown> = {};\n for (const key of Object.keys(this.pendingPreferences)) {\n const newValue = this.pendingPreferences[key];\n const oldValue = this.serverPreferences[key];\n\n if (JSON.stringify(newValue) !== JSON.stringify(oldValue)) {\n changedPreferences[key] = newValue;\n }\n }\n\n this.pendingPreferences = {};\n\n if (Object.keys(changedPreferences).length > 0) {\n this.userService?.updatePreference(changedPreferences).subscribe(() => {\n Object.assign(this.serverPreferences, changedPreferences);\n });\n }\n }\n}\n","import { Injectable, inject } from '@angular/core';\nimport {\n ActivatedRouteSnapshot,\n Router,\n RouterStateSnapshot\n} from '@angular/router';\n\nimport { ConfigService } from '@igo2/core/config';\n\nimport { AuthOptions } from './auth.interface';\nimport { AuthService } from './auth.service';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class AuthGuard {\n private authService = inject(AuthService);\n private config = inject(ConfigService);\n private router = inject(Router);\n\n canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot) {\n if (this.authService.authenticated) {\n return true;\n }\n\n this.authService.redirectUrl = state.url;\n\n const authConfig = this.config.getConfig('auth') as AuthOptions;\n if (authConfig?.loginRoute) {\n this.router.navigateByUrl(authConfig.loginRoute);\n }\n\n return false;\n }\n}\n","import { HttpClient } from '@angular/common/http';\nimport {\n HttpEvent,\n HttpHandler,\n HttpInterceptor,\n HttpRequest\n} from '@angular/common/http';\nimport { Injectable, inject } from '@angular/core';\n\nimport { ConfigService } from '@igo2/core/config';\n\nimport { Observable } from 'rxjs';\nimport { Md5 } from 'ts-md5';\n\nimport {\n AuthByKeyOptions,\n AuthOptions,\n WithCredentialsOptions\n} from './auth.interface';\nimport { TokenService } from './token.service';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class AuthInterceptor implements HttpInterceptor {\n private config = inject(ConfigService);\n private tokenService = inject(TokenService);\n private http = inject(HttpClient);\n\n private authOptions: AuthOptions;\n private refreshInProgress = false;\n private trustHosts: string[];\n private hostsWithCredentials: WithCredentialsOptions[];\n private hostsWithAuthByKey: AuthByKeyOptions[];\n\n constructor() {\n this.authOptions = this.config.getConfig('auth') as AuthOptions;\n\n this.trustHosts = this.authOptions?.trustHosts || [];\n this.trustHosts.push(window.location.hostname);\n\n this.hostsWithCredentials = this.authOptions?.hostsWithCredentials || [];\n this.hostsWithAuthByKey = this.authOptions?.hostsByKey || [];\n }\n\n intercept(\n originalReq: HttpRequest<unknown>,\n next: HttpHandler\n ): Observable<HttpEvent<unknown>> {\n const withCredentials = this.handleHostsWithCredentials(originalReq.url);\n let req = originalReq.clone();\n const hostWithKey = this.handleHostsAuthByKey(originalReq.url);\n if (hostWithKey) {\n req = req.clone({\n params: req.params.set(hostWithKey.key, hostWithKey.value)\n });\n }\n if (withCredentials) {\n req = originalReq.clone({\n withCredentials\n });\n return next.handle(req);\n }\n this.refreshToken();\n const token = this.tokenService.get();\n const element = document.createElement('a');\n element.href = req.url;\n\n if (!token || this.trustHosts.indexOf(element.hostname) === -1) {\n return next.handle(req);\n }\n\n const authHeader = `Bearer ${token}`;\n let authReq = req.clone({\n headers: req.headers.set('Authorization', authHeader)\n });\n\n const tokenDecoded = this.tokenService.decode();\n if (authReq.params.get('_i') === 'true' && tokenDecoded?.user?.sourceId) {\n const hashUser = Md5.hashStr(tokenDecoded.user.sourceId) as string;\n authReq = authReq.clone({\n params: authReq.params.set('_i', hashUser)\n });\n } else if (authReq.params.get('_i') === 'true') {\n authReq = authReq.clone({\n params: authReq.params.delete('_i')\n });\n }\n\n return next.handle(authReq);\n }\n\n interceptXhr(xhr, url: string): boolean {\n const withCredentials = this.handleHostsWithCredentials(url);\n if (withCredentials) {\n xhr.withCredentials = withCredentials;\n return true;\n }\n\n this.refreshToken();\n const element = document.createElement('a');\n element.href = url;\n\n const token = this.tokenService.get();\n if (!token || this.trustHosts.indexOf(element.hostname) === -1) {\n return false;\n }\n xhr.setRequestHeader('Authorization', 'Bearer ' + token);\n return true;\n }\n\n alterUrlWithKeyAuth(url: string): string {\n const hostWithKey = this.handleHostsAuthByKey(url);\n const interceptedUrl = url;\n if (hostWithKey) {\n const urlDecomposed = interceptedUrl.split(/[?&]/);\n let urlWithKeyAdded = urlDecomposed.shift();\n const paramsToKeep = urlDecomposed.filter((p) => p.length !== 0);\n paramsToKeep.push(`${hostWithKey.key}=${hostWithKey.value}`);\n if (paramsToKeep.length) {\n urlWithKeyAdded += '?' + paramsToKeep.join('&');\n }\n return urlWithKeyAdded;\n }\n return;\n }\n\n private handleHostsWithCredentials(reqUrl: string) {\n let withCredentials = false;\n for (const hostWithCredentials of this.hostsWithCredentials) {\n const domainRegex = new RegExp(hostWithCredentials.domainRegFilters);\n if (domainRegex.test(reqUrl)) {\n withCredentials =\n hostWithCredentials.withCredentials !== undefined\n ? hostWithCredentials.withCredentials\n : undefined;\n break;\n }\n }\n return withCredentials;\n }\n\n private handleHostsAuthByKey(reqUrl: string): { key: string; value: string } {\n let hostWithKey;\n for (const hostWithAuthByKey of this.hostsWithAuthByKey) {\n const domainRegex = new RegExp(hostWithAuthByKey.domainRegFilters);\n if (domainRegex.test(reqUrl)) {\n const replace = `${hostWithAuthByKey.keyProperty}=${hostWithAuthByKey.keyValue}`;\n const keyAdded = new RegExp(replace, 'gm');\n if (!keyAdded.test(reqUrl)) {\n hostWithKey = {\n key: hostWithAuthByKey.keyProperty,\n value: hostWithAuthByKey.keyValue\n };\n break;\n }\n }\n }\n return hostWithKey;\n }\n\n refreshToken() {\n const jwt = this.tokenService.decode();\n const currentTime = new Date().getTime() / 1000;\n\n if (\n !this.refreshInProgress &&\n jwt &&\n currentTime < jwt.exp &&\n currentTime > jwt.exp - 1800\n ) {\n this.refreshInProgress = true;\n\n const url = this.authOptions?.url;\n return this.http.post(`${url}/refresh`, {}).subscribe(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (data: any) => {\n this.tokenService.set(data.token);\n this.refreshInProgress = false;\n },\n (err) => {\n err.error.caught = true;\n return err;\n }\n );\n }\n }\n}\n","import { Provider } from '@angular/core';\n\nimport { BaseUser } from '@igo2/core/user';\n\nexport interface AuthInternOptions {\n enabled?: boolean;\n}\n\nexport interface AuthFacebookOptions {\n enabled?: boolean;\n appId: string;\n}\n\nexport interface AuthGoogleOptions {\n enabled?: boolean;\n apiKey: string;\n clientId: string;\n}\n\nexport interface AuthByKeyOptions {\n domainRegFilters?: string;\n keyProperty?: string;\n keyValue?: string;\n}\nexport interface WithCredentialsOptions {\n withCredentials?: boolean;\n domainRegFilters?: string;\n}\n\nexport interface User extends BaseUser {\n source?: string;\n sourceId?: string;\n locale?: string;\n isExpired?: boolean;\n isAdmin?: boolean;\n defaultContextId?: string;\n}\n\nexport interface IInfosUser {\n tokenId: string;\n}\n\nexport interface AuthOptions {\n url: string;\n /** User api url is the igo user versus the url is the authentification API */\n user?: IAuthUserIgoOptions;\n tokenKey?: string;\n allowAnonymous?: boolean;\n loginRoute?: string;\n logoutRedirectRoute?: string;\n logoutRoute?: string;\n homeRoute?: string;\n trustHosts?: string[];\n profilsGuard?: string[];\n hostsWithCredentials?: WithCredentialsOptions[];\n hostsByKey?: AuthByKeyOptions[];\n intern?: AuthInternOptions;\n}\n\nexport interface IAuthUserIgoOptions {\n apiUrl: string;\n // Allow to sync the user. Use it when the user may not exist on the user API system.\n withSync?: boolean;\n}\n\nexport interface AuthByKeyOptions {\n domainRegFilters?: string;\n keyProperty?: string;\n keyValue?: string;\n}\nexport interface WithCredentialsOptions {\n withCredentials?: boolean;\n domainRegFilters?: string;\n}\n\nexport interface AuthInternOptions {\n enabled?: boolean;\n}\n\nexport interface AuthFeature<KindT extends AuthFeatureKind> {\n kind: KindT;\n providers: Provider[];\n}\n\nexport enum AuthFeatureKind {\n Microsoft = 0,\n User\n}\n","import { Injectable, inject } from '@angular/core';\nimport {\n ActivatedRouteSnapshot,\n Router,\n RouterStateSnapshot\n} from '@angular/router';\n\nimport { ConfigService } from '@igo2/core/config';\n\nimport { AuthOptions } from './auth.interface';\nimport { AuthService } from './auth.service';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class LoggedGuard {\n private authService = inject(AuthService);\n private config = inject(ConfigService);\n private router = inject(Router);\n\n canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot) {\n if (this.authService.logged) {\n return true;\n }\n\n this.authService.redirectUrl = state.url;\n\n const authConfig = this.config.getConfig('auth') as AuthOptions;\n if (authConfig?.loginRoute) {\n this.router.navigateByUrl(authConfig.loginRoute);\n }\n\n return false;\n }\n}\n","import { Injectable, inject } from '@angular/core';\nimport {\n ActivatedRouteSnapshot,\n Router,\n RouterStateSnapshot\n} from '@angular/router';\n\nimport { ConfigService } from '@igo2/core/config';\n\nimport { map } from 'rxjs/operators';\n\nimport { AuthOptions } from './auth.interface';\nimport { AuthService } from './auth.service';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class ProfilsGuard {\n private authService = inject(AuthService);\n private config = inject(ConfigService);\n private router = inject(Router);\n\n canActivate(_route: ActivatedRouteSnapshot, state: RouterStateSnapshot) {\n return this.authService.getProfils().pipe(\n map((profils: { profils: string[] }) => {\n const authConfig = this.config.getConfig('auth') as AuthOptions;\n if (\n profils &&\n profils.profils &&\n profils.profils.some((v) => authConfig.profilsGuard.indexOf(v) !== -1)\n ) {\n return true;\n }\n\n this.authService.redirectUrl = state.url;\n\n if (authConfig?.loginRoute) {\n this.router.navigateByUrl(authConfig.loginRoute);\n }\n\n return false;\n })\n );\n }\n}\n","import { ConfigService } from '@igo2/core/config';\n\nimport {\n AuthFeature,\n AuthFeatureKind,\n IAuthUserIgoOptions\n} from '../auth.interface';\nimport { USER_AUTH_OPTIONS, UserService } from './user.service';\n\nexport function withUserIgo(): AuthFeature<AuthFeatureKind.User> {\n return {\n kind: AuthFeatureKind.User,\n providers: [\n {\n provide: USER_AUTH_OPTIONS,\n useFactory: (config: ConfigService) => config.getConfig('auth.user'),\n deps: [ConfigService]\n },\n {\n provide: UserService,\n useFactory: (options: IAuthUserIgoOptions | undefined) => {\n if (!options) {\n return undefined;\n }\n\n return new UserService();\n },\n deps: [USER_AUTH_OPTIONS]\n }\n ]\n };\n}\n","import { HTTP_INTERCEPTORS } from '@angular/common/http';\nimport {\n EnvironmentProviders,\n Provider,\n makeEnvironmentProviders\n} from '@angular/core';\n\nimport { StorageService } from '@igo2/core/storage';\n\nimport {\n AuthFeature,\n AuthFeatureKind,\n AuthInterceptor,\n AuthStorageService\n} from './shared';\n\nexport function provideAuthentification(\n ...features: AuthFeature<AuthFeatureKind>[]\n): EnvironmentProviders {\n const providers: Provider[] = [\n {\n provide: HTTP_INTERCEPTORS,\n useClass: AuthInterceptor,\n multi: true\n },\n {\n provide: StorageService,\n useClass: AuthStorageService\n }\n ];\n\n for (const feature of features) {\n providers.push(...feature.providers);\n }\n\n return makeEnvironmentProviders(providers);\n}\n","/*\n * Public API Surface of auth\n */\nexport * from './lib/auth.provider';\nexport * from './lib/shared';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["tap"],"mappings":";;;;;;;;;;;;;;;MAYa,YAAY,CAAA;AACf,IAAA,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;AAE3B,IAAA,OAAO;AACP,IAAA,QAAQ;AAEhB,IAAA,WAAA,GAAA;QACE,MAAM,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAgB,aAAa,CAAC;QAC9D,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC;QACvC,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,OAAO,EAAE,QAAQ;IACxC;AAEA,IAAA,GAAG,CAAC,KAAa,EAAA;QACf,YAAY,CAAC,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wB,CAAC,SAAS,CAAC;AAC5C;;ACpCA;;AAEG;;ACFH;;AAEG;;;;"}
1
+ {"version":3,"file":"igo2-auth.mjs","sources":["../../../packages/auth/src/lib/shared/token.service.ts","../../../packages/auth/src/lib/shared/user/user.service.ts","../../../packages/auth/src/lib/shared/auth.service.ts","../../../packages/auth/src/lib/shared/admin.guard.ts","../../../packages/auth/src/lib/shared/auth-storage.service.ts","../../../packages/auth/src/lib/shared/auth.guard.ts","../../../packages/auth/src/lib/shared/auth.interceptor.ts","../../../packages/auth/src/lib/shared/auth.interface.ts","../../../packages/auth/src/lib/shared/logged.guard.ts","../../../packages/auth/src/lib/shared/profils.guard.ts","../../../packages/auth/src/lib/shared/user/user.provider.ts","../../../packages/auth/src/lib/auth.provider.ts","../../../packages/auth/src/public_api.ts","../../../packages/auth/src/igo2-auth.ts"],"sourcesContent":["import { Injectable, Injector, inject } from '@angular/core';\n\nimport { ConfigService } from '@igo2/core/config';\n\nimport { jwtDecode } from 'jwt-decode';\n\nimport { AuthOptions } from './auth.interface';\nimport { IgoJwtPayload } from './token.interface';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class TokenService {\n private injector = inject(Injector);\n\n private options?: AuthOptions;\n private tokenKey: string;\n\n constructor() {\n const config = this.injector.get<ConfigService>(ConfigService);\n this.options = config.getConfig('auth');\n this.tokenKey = this.options?.tokenKey ?? '';\n }\n\n set(token: string) {\n localStorage.setItem(this.tokenKey, token);\n }\n\n remove() {\n localStorage.removeItem(this.tokenKey);\n }\n\n get(): string | undefined {\n return localStorage.getItem(this.tokenKey) ?? undefined;\n }\n\n decode(): IgoJwtPayload | undefined {\n const token = this.get();\n if (!token) {\n return;\n }\n return jwtDecode(token) satisfies IgoJwtPayload;\n }\n\n isExpired() {\n const jwt = this.decode();\n const currentTime = new Date().getTime() / 1000;\n if (jwt?.exp && currentTime < jwt.exp) {\n return false;\n }\n return true;\n }\n}\n","import { HttpClient } from '@angular/common/http';\nimport { Injectable, InjectionToken, inject } from '@angular/core';\n\nimport { BehaviorSubject, Observable, tap } from 'rxjs';\n\nimport { IAuthUserIgoOptions } from '../auth.interface';\nimport { IUser, IUserPreference } from './user.interface';\n\nexport const USER_AUTH_OPTIONS = new InjectionToken<IAuthUserIgoOptions>(\n 'USER_AUTH_OPTIONS'\n);\n\n@Injectable()\nexport class UserService {\n private http = inject(HttpClient);\n private options = inject(USER_AUTH_OPTIONS);\n\n private baseUrl: string;\n\n private _user$ = new BehaviorSubject<IUser | undefined>(undefined);\n user$ = this._user$.asObservable();\n\n constructor() {\n this.baseUrl = this.options.apiUrl;\n }\n\n getUser(): Observable<IUser> {\n return this.http\n .get<IUser>(this.baseUrl)\n .pipe(tap((user) => this._user$.next(user)));\n }\n\n sync(): Observable<IUser> {\n return this.http\n .get<IUser>(`${this.baseUrl}/sync`)\n .pipe(tap((user) => this._user$.next(user)));\n }\n\n updatePreference(preference: IUserPreference) {\n return this.http.patch<{ id: number }>(this.baseUrl, { preference });\n }\n}\n","import { HttpClient, HttpHeaders } from '@angular/common/http';\nimport { Injectable, inject, signal } from '@angular/core';\nimport { Router } from '@angular/router';\n\nimport { ConfigService } from '@igo2/core/config';\nimport { LanguageService } from '@igo2/core/language';\nimport { MessageService } from '@igo2/core/message';\nimport { Base64 } from '@igo2/utils';\n\nimport { BehaviorSubject, Observable, of } from 'rxjs';\nimport { catchError, finalize, switchMap, tap } from 'rxjs/operators';\nimport { globalCacheBusterNotifier } from 'ts-cacheable';\n\nimport { AuthOptions, IInfosUser, User } from './auth.interface';\nimport { IgoJwtPayload } from './token.interface';\nimport { TokenService } from './token.service';\nimport { IUser } from './user/user.interface';\nimport { UserService } from './user/user.service';\n\ninterface IToken {\n token: string;\n}\n\n@Injectable({\n providedIn: 'root'\n})\nexport class AuthService<T extends AuthOptions = AuthOptions> {\n private http = inject(HttpClient);\n private tokenService = inject(TokenService);\n private userService = inject(UserService, {\n optional: true\n });\n private config = inject(ConfigService);\n private languageService = inject(LanguageService);\n private messageService = inject(MessageService);\n private router = inject(Router, { optional: true });\n\n public authenticate$ = new BehaviorSubject<boolean>(false);\n public logged$ = new BehaviorSubject<boolean>(false);\n public redirectUrl?: string;\n public languageForce = false;\n public authOptions: T;\n\n private anonymous = false;\n\n isLogging = signal(false);\n\n get hasAuthService() {\n return this.authOptions?.url !== undefined;\n }\n\n get user(): User | null {\n const decodedToken = this.decodeToken();\n return decodedToken?.user ? decodedToken.user : null;\n }\n\n constructor() {\n this.authOptions = this.config.getConfig('auth');\n\n this.initializeAuthentication(this.authenticated).subscribe();\n\n this.authenticate$.subscribe((authenticated) => {\n this.logged$.next(authenticated);\n globalCacheBusterNotifier.next();\n });\n }\n\n login(username: string, password: string): Observable<IUser | null> {\n this.isLogging.set(true);\n const myHeader = new HttpHeaders({ 'Content-Type': 'application/json' });\n\n const body = {\n username,\n password: this.encodePassword(password)\n };\n\n return this.loginCall(body, myHeader).pipe(\n finalize(() => this.isLogging.set(false))\n );\n }\n\n loginWithToken(\n token: string,\n type: string,\n infosUser?: IInfosUser,\n applicationId?: string\n ): Observable<IUser | null> {\n const myHeader = new HttpHeaders({ 'Content-Type': 'application/json' });\n\n const body = {\n token,\n typeConnection: type,\n infosUser,\n applicationId\n };\n\n return this.loginCall(body, myHeader);\n }\n\n loginAnonymous(): Observable<boolean> {\n this.anonymous = true;\n this.logged$.next(true);\n return of(true);\n }\n\n refresh(): Observable<IToken> {\n return this.http.post<IToken>(`${this.authOptions?.url}/refresh`, {}).pipe(\n tap((data) => {\n this.tokenService.set(data.token);\n }),\n catchError((err) => {\n err.error.caught = true;\n throw err;\n })\n );\n }\n\n logout(): void {\n this.logoutInternal();\n if (this.authOptions.logoutRedirectRoute) {\n this.router?.navigate([this.authOptions.logoutRedirectRoute]);\n }\n }\n\n private logoutInternal(): void {\n this.anonymous = false;\n this.tokenService.remove();\n this.authenticate$.next(false);\n }\n\n isAuthenticated(): boolean {\n return !this.tokenService.isExpired();\n }\n\n getToken(): string | undefined {\n return this.tokenService.get();\n }\n\n decodeToken(): IgoJwtPayload | undefined {\n if (this.isAuthenticated()) {\n return this.tokenService.decode();\n }\n return;\n }\n\n goToRedirectUrl() {\n if (!this.router) {\n return;\n }\n const redirectUrl = this.redirectUrl ?? this.authOptions.homeRoute ?? '/';\n\n this.router.navigateByUrl(redirectUrl);\n }\n\n getUserInfo(): Observable<User> {\n const url = this.authOptions?.url + '/info';\n return this.http.get<User>(url);\n }\n\n getProfils(): Observable<{ profils: string[] }> {\n return this.http.get<{ profils: string[] }>(\n `${this.authOptions?.url}/profils`\n );\n }\n\n updateUser(user: User): Observable<User> {\n return this.http.patch<User>(this.authOptions?.url, user);\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n translateError(prefix: string, error: any): Observable<string> {\n return new Observable((observer) => {\n try {\n this.languageService.translate\n .get(prefix + error.error.message)\n .subscribe((errorMsg) => {\n observer.next(errorMsg);\n observer.complete();\n });\n } catch {\n if (error.error) observer.next(error.error.message);\n observer.complete();\n }\n });\n }\n\n private encodePassword(password: string) {\n return Base64.encode(password);\n }\n\n // authenticated or anonymous\n get logged(): boolean {\n return this.authenticated || this.isAnonymous;\n }\n\n get isAnonymous(): boolean {\n return this.anonymous;\n }\n\n get authenticated(): boolean {\n return this.isAuthenticated();\n }\n\n get isAdmin(): boolean {\n const token = this.decodeToken();\n if (token?.user?.isAdmin) {\n return true;\n }\n return false;\n }\n\n protected loginCall(body: unknown, headers: HttpHeaders) {\n return this.http\n .post<IToken>(`${this.authOptions?.url}/login`, body, { headers })\n .pipe(\n tap((data) => {\n this.tokenService.set(data.token);\n const tokenDecoded = this.decodeToken();\n if (tokenDecoded?.user) {\n if (tokenDecoded.user.locale && !this.languageForce) {\n this.languageService.setLanguage(tokenDecoded.user.locale);\n }\n if (tokenDecoded.user.isExpired) {\n this.messageService.alert(\n 'igo.auth.error.intern.Password expired'\n );\n }\n }\n }),\n switchMap(() => this.initializeAuthentication(true))\n );\n }\n\n private initializeAuthentication(\n isAuthenticated: boolean\n ): Observable<IUser | null> {\n if (!isAuthenticated) {\n this.authenticate$.next(false);\n return of(null);\n }\n\n if (this.userService) {\n const obs$ = this.authOptions.user?.withSync\n ? this.userService.sync()\n : this.userService.getUser();\n\n return obs$.pipe(tap(() => this.authenticate$.next(true)));\n }\n\n this.authenticate$.next(true);\n return of(null);\n }\n}\n","import { Injectable, inject } from '@angular/core';\nimport {\n ActivatedRouteSnapshot,\n Router,\n RouterStateSnapshot\n} from '@angular/router';\n\nimport { ConfigService } from '@igo2/core/config';\n\nimport { AuthOptions } from './auth.interface';\nimport { AuthService } from './auth.service';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class AdminGuard {\n private authService = inject(AuthService);\n private config = inject(ConfigService);\n private router = inject(Router);\n\n canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot) {\n if (this.authService.isAdmin) {\n return true;\n }\n\n this.authService.redirectUrl = state.url;\n\n const authConfig = this.config.getConfig('auth') as AuthOptions;\n if (authConfig?.loginRoute) {\n this.router.navigateByUrl(authConfig.loginRoute);\n }\n\n return false;\n }\n}\n","import { Injectable, OnDestroy, inject } from '@angular/core';\n\nimport { ConfigService } from '@igo2/core/config';\nimport { BaseStorage, StorageScope } from '@igo2/core/storage';\n\nimport { EMPTY, Subject } from 'rxjs';\nimport { debounceTime, switchMap, takeUntil } from 'rxjs/operators';\n\nimport { AuthStorageOptions } from './auth-storage.interface';\nimport { AuthService } from './auth.service';\nimport { TokenService } from './token.service';\nimport { UserService } from './user/user.service';\n\nconst DEBOUNCE_TIME = 3000; // 3 seconds;\n\n@Injectable({\n providedIn: 'root'\n})\nexport class AuthStorageService\n extends BaseStorage<AuthStorageOptions>\n implements OnDestroy\n{\n private authService = inject(AuthService);\n private userService = inject(UserService, {\n optional: true\n });\n private tokenService = inject(TokenService);\n\n private preferencesChanged$ = new Subject<void>();\n private destroy$ = new Subject<void>();\n private pendingPreferences: Record<string, unknown> = {};\n private serverPreferences: Record<string, unknown> = {};\n\n constructor() {\n const config = inject(ConfigService);\n super(config);\n\n this.authService.authenticate$\n .pipe(\n switchMap((isAuthenticated) => {\n if (isAuthenticated && this.userService) {\n return this.userService.user$;\n }\n return EMPTY;\n }),\n takeUntil(this.destroy$)\n )\n .subscribe((user) => {\n if (!user?.preference) {\n return;\n }\n\n this.serverPreferences = { ...user.preference };\n for (const key of Object.keys(user.preference)) {\n const value = user.preference[key];\n super.set(key, value);\n }\n });\n\n this.preferencesChanged$\n .pipe(\n debounceTime(DEBOUNCE_TIME), // Wait for more changes to accumulate\n takeUntil(this.destroy$)\n )\n .subscribe(() => {\n this.syncPreferences();\n });\n }\n\n ngOnDestroy() {\n this.destroy$.next();\n this.destroy$.complete();\n this.preferencesChanged$.complete();\n }\n\n set(\n key: string,\n value: string | object | boolean | number,\n scope: StorageScope = StorageScope.LOCAL\n ) {\n if (scope === StorageScope.LOCAL && this.authService.authenticated) {\n this.pendingPreferences[key] = value;\n this.preferencesChanged$.next();\n }\n super.set(key, value, scope);\n }\n\n remove(key: string, scope: StorageScope = StorageScope.LOCAL) {\n if (scope === StorageScope.LOCAL && this.authService.authenticated) {\n this.pendingPreferences[key] = undefined;\n this.preferencesChanged$.next();\n }\n super.remove(key, scope);\n }\n\n clear(scope: StorageScope = StorageScope.LOCAL) {\n if (scope === StorageScope.LOCAL && this.authService.authenticated) {\n this.pendingPreferences = {};\n this.preferencesChanged$.next();\n }\n\n let token: string | undefined;\n if (scope === StorageScope.LOCAL) {\n token = this.tokenService.get();\n }\n\n super.clear(scope);\n\n if (token) {\n this.tokenService.set(token);\n }\n }\n\n private syncPreferences() {\n if (Object.keys(this.pendingPreferences).length === 0) {\n return;\n }\n\n // Filter out preferences that haven't actually changed\n const changedPreferences: Record<string, unknown> = {};\n for (const key of Object.keys(this.pendingPreferences)) {\n const newValue = this.pendingPreferences[key];\n const oldValue = this.serverPreferences[key];\n\n if (JSON.stringify(newValue) !== JSON.stringify(oldValue)) {\n changedPreferences[key] = newValue;\n }\n }\n\n this.pendingPreferences = {};\n\n if (Object.keys(changedPreferences).length > 0) {\n this.userService?.updatePreference(changedPreferences).subscribe(() => {\n Object.assign(this.serverPreferences, changedPreferences);\n });\n }\n }\n}\n","import { Injectable, inject } from '@angular/core';\nimport {\n ActivatedRouteSnapshot,\n Router,\n RouterStateSnapshot\n} from '@angular/router';\n\nimport { ConfigService } from '@igo2/core/config';\n\nimport { AuthOptions } from './auth.interface';\nimport { AuthService } from './auth.service';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class AuthGuard {\n private authService = inject(AuthService);\n private config = inject(ConfigService);\n private router = inject(Router);\n\n canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot) {\n if (this.authService.authenticated) {\n return true;\n }\n\n this.authService.redirectUrl = state.url;\n\n const authConfig = this.config.getConfig('auth') as AuthOptions;\n if (authConfig?.loginRoute) {\n this.router.navigateByUrl(authConfig.loginRoute);\n }\n\n return false;\n }\n}\n","import { HttpClient } from '@angular/common/http';\nimport {\n HttpEvent,\n HttpHandler,\n HttpInterceptor,\n HttpRequest\n} from '@angular/common/http';\nimport { Injectable, inject } from '@angular/core';\n\nimport { IXhrInterceptor } from '@igo2/core/auth';\nimport { ConfigService } from '@igo2/core/config';\n\nimport { Observable } from 'rxjs';\nimport { Md5 } from 'ts-md5';\n\nimport {\n AuthByKeyOptions,\n AuthOptions,\n WithCredentialsOptions\n} from './auth.interface';\nimport { TokenService } from './token.service';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class AuthInterceptor implements HttpInterceptor, IXhrInterceptor {\n private config = inject(ConfigService);\n private tokenService = inject(TokenService);\n private http = inject(HttpClient);\n\n private authOptions: AuthOptions;\n private refreshInProgress = false;\n private trustHosts: string[];\n private hostsWithCredentials: WithCredentialsOptions[];\n private hostsWithAuthByKey: AuthByKeyOptions[];\n\n constructor() {\n this.authOptions = this.config.getConfig('auth') as AuthOptions;\n\n this.trustHosts = this.authOptions?.trustHosts || [];\n this.trustHosts.push(window.location.hostname);\n\n this.hostsWithCredentials = this.authOptions?.hostsWithCredentials || [];\n this.hostsWithAuthByKey = this.authOptions?.hostsByKey || [];\n }\n\n intercept(\n originalReq: HttpRequest<unknown>,\n next: HttpHandler\n ): Observable<HttpEvent<unknown>> {\n const withCredentials = this.handleHostsWithCredentials(originalReq.url);\n let req = originalReq.clone();\n const hostWithKey = this.handleHostsAuthByKey(originalReq.url);\n if (hostWithKey) {\n req = req.clone({\n params: req.params.set(hostWithKey.key, hostWithKey.value)\n });\n }\n if (withCredentials) {\n req = originalReq.clone({\n withCredentials\n });\n return next.handle(req);\n }\n this.refreshToken();\n const token = this.tokenService.get();\n const element = document.createElement('a');\n element.href = req.url;\n\n if (!token || this.trustHosts.indexOf(element.hostname) === -1) {\n return next.handle(req);\n }\n\n const authHeader = `Bearer ${token}`;\n let authReq = req.clone({\n headers: req.headers.set('Authorization', authHeader)\n });\n\n const tokenDecoded = this.tokenService.decode();\n if (authReq.params.get('_i') === 'true' && tokenDecoded?.user?.sourceId) {\n const hashUser = Md5.hashStr(tokenDecoded.user.sourceId) as string;\n authReq = authReq.clone({\n params: authReq.params.set('_i', hashUser)\n });\n } else if (authReq.params.get('_i') === 'true') {\n authReq = authReq.clone({\n params: authReq.params.delete('_i')\n });\n }\n\n return next.handle(authReq);\n }\n\n interceptXhr(xhr: XMLHttpRequest, url: string): boolean {\n const withCredentials = this.handleHostsWithCredentials(url);\n if (withCredentials) {\n xhr.withCredentials = withCredentials;\n return true;\n }\n\n this.refreshToken();\n const element = document.createElement('a');\n element.href = url;\n\n const token = this.tokenService.get();\n if (!token || this.trustHosts.indexOf(element.hostname) === -1) {\n return false;\n }\n xhr.setRequestHeader('Authorization', 'Bearer ' + token);\n return true;\n }\n\n alterUrlWithKeyAuth(url: string): string | undefined {\n const hostWithKey = this.handleHostsAuthByKey(url);\n const interceptedUrl = url;\n if (hostWithKey) {\n const urlDecomposed = interceptedUrl.split(/[?&]/);\n let urlWithKeyAdded = urlDecomposed.shift();\n const paramsToKeep = urlDecomposed.filter((p) => p.length !== 0);\n paramsToKeep.push(`${hostWithKey.key}=${hostWithKey.value}`);\n if (paramsToKeep.length) {\n urlWithKeyAdded += '?' + paramsToKeep.join('&');\n }\n return urlWithKeyAdded;\n }\n return;\n }\n\n private handleHostsWithCredentials(reqUrl: string) {\n let withCredentials = false;\n for (const hostWithCredentials of this.hostsWithCredentials) {\n if (!hostWithCredentials.domainRegFilters) {\n return;\n }\n const domainRegex = new RegExp(hostWithCredentials.domainRegFilters);\n if (domainRegex.test(reqUrl)) {\n withCredentials =\n hostWithCredentials.withCredentials !== undefined\n ? hostWithCredentials.withCredentials\n : false;\n break;\n }\n }\n return withCredentials;\n }\n\n private handleHostsAuthByKey(\n reqUrl: string\n ): { key: string; value: string } | undefined {\n let hostWithKey: { key: string; value: string } | undefined;\n for (const hostWithAuthByKey of this.hostsWithAuthByKey) {\n if (!hostWithAuthByKey.domainRegFilters) {\n return;\n }\n const domainRegex = new RegExp(hostWithAuthByKey.domainRegFilters);\n if (domainRegex.test(reqUrl)) {\n const replace = `${hostWithAuthByKey.keyProperty}=${hostWithAuthByKey.keyValue}`;\n const keyAdded = new RegExp(replace, 'gm');\n if (!keyAdded.test(reqUrl)) {\n hostWithKey = {\n key: hostWithAuthByKey.keyProperty,\n value: hostWithAuthByKey.keyValue\n };\n break;\n }\n }\n }\n return hostWithKey;\n }\n\n refreshToken() {\n const jwt = this.tokenService.decode();\n const currentTime = new Date().getTime() / 1000;\n\n if (\n !this.refreshInProgress &&\n jwt?.exp &&\n currentTime < jwt.exp &&\n currentTime > jwt.exp - 1800\n ) {\n this.refreshInProgress = true;\n\n const url = this.authOptions?.url;\n return this.http.post(`${url}/refresh`, {}).subscribe(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (data: any) => {\n this.tokenService.set(data.token);\n this.refreshInProgress = false;\n },\n (err) => {\n err.error.caught = true;\n return err;\n }\n );\n }\n }\n}\n","import { Provider } from '@angular/core';\n\nimport { BaseUser } from '@igo2/core/user';\n\nexport interface AuthInternOptions {\n enabled?: boolean;\n}\n\nexport interface User extends BaseUser {\n source?: string;\n sourceId?: string;\n locale?: string;\n isExpired?: boolean;\n isAdmin?: boolean;\n defaultContextId?: string;\n}\n\nexport interface IInfosUser {\n tokenId: string;\n}\n\nexport interface AuthOptions {\n url: string;\n /** User api url is the igo user versus the url is the authentification API */\n user?: IAuthUserIgoOptions;\n tokenKey?: string;\n allowAnonymous?: boolean;\n loginRoute?: string;\n logoutRedirectRoute?: string;\n logoutRoute?: string;\n homeRoute?: string;\n trustHosts?: string[];\n profilsGuard?: string[];\n hostsWithCredentials?: WithCredentialsOptions[];\n hostsByKey?: AuthByKeyOptions[];\n intern?: AuthInternOptions;\n}\n\nexport interface IAuthUserIgoOptions {\n apiUrl: string;\n // Allow to sync the user. Use it when the user may not exist on the user API system.\n withSync?: boolean;\n}\n\nexport interface AuthByKeyOptions {\n domainRegFilters?: string;\n keyProperty: string;\n keyValue: string;\n}\nexport interface WithCredentialsOptions {\n withCredentials?: boolean;\n domainRegFilters?: string;\n}\n\nexport interface AuthInternOptions {\n enabled?: boolean;\n}\n\nexport interface AuthFeature<KindT extends AuthFeatureKind> {\n kind: KindT;\n providers: Provider[];\n}\n\nexport enum AuthFeatureKind {\n Microsoft = 0,\n User\n}\n","import { Injectable, inject } from '@angular/core';\nimport {\n ActivatedRouteSnapshot,\n Router,\n RouterStateSnapshot\n} from '@angular/router';\n\nimport { ConfigService } from '@igo2/core/config';\n\nimport { AuthOptions } from './auth.interface';\nimport { AuthService } from './auth.service';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class LoggedGuard {\n private authService = inject(AuthService);\n private config = inject(ConfigService);\n private router = inject(Router);\n\n canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot) {\n if (this.authService.logged) {\n return true;\n }\n\n this.authService.redirectUrl = state.url;\n\n const authConfig = this.config.getConfig('auth') as AuthOptions;\n if (authConfig?.loginRoute) {\n this.router.navigateByUrl(authConfig.loginRoute);\n }\n\n return false;\n }\n}\n","import { Injectable, inject } from '@angular/core';\nimport {\n ActivatedRouteSnapshot,\n Router,\n RouterStateSnapshot\n} from '@angular/router';\n\nimport { ConfigService } from '@igo2/core/config';\n\nimport { map } from 'rxjs/operators';\n\nimport { AuthOptions } from './auth.interface';\nimport { AuthService } from './auth.service';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class ProfilsGuard {\n private authService = inject(AuthService);\n private config = inject(ConfigService);\n private router = inject(Router);\n\n canActivate(_route: ActivatedRouteSnapshot, state: RouterStateSnapshot) {\n return this.authService.getProfils().pipe(\n map((profils: { profils: string[] }) => {\n const authConfig = this.config.getConfig('auth') as AuthOptions;\n if (\n profils &&\n profils.profils &&\n profils.profils.some(\n (v) => authConfig.profilsGuard?.indexOf(v) !== -1\n )\n ) {\n return true;\n }\n\n this.authService.redirectUrl = state.url;\n\n if (authConfig?.loginRoute) {\n this.router.navigateByUrl(authConfig.loginRoute);\n }\n\n return false;\n })\n );\n }\n}\n","import { ConfigService } from '@igo2/core/config';\n\nimport {\n AuthFeature,\n AuthFeatureKind,\n IAuthUserIgoOptions\n} from '../auth.interface';\nimport { USER_AUTH_OPTIONS, UserService } from './user.service';\n\nexport function withUserIgo(): AuthFeature<AuthFeatureKind.User> {\n return {\n kind: AuthFeatureKind.User,\n providers: [\n {\n provide: USER_AUTH_OPTIONS,\n useFactory: (config: ConfigService) => config.getConfig('auth.user'),\n deps: [ConfigService]\n },\n {\n provide: UserService,\n useFactory: (options: IAuthUserIgoOptions | undefined) => {\n if (!options) {\n return undefined;\n }\n\n return new UserService();\n },\n deps: [USER_AUTH_OPTIONS]\n }\n ]\n };\n}\n","import { HTTP_INTERCEPTORS } from '@angular/common/http';\nimport {\n EnvironmentProviders,\n Provider,\n makeEnvironmentProviders\n} from '@angular/core';\n\nimport { XHR_INTERCEPTOR } from '@igo2/core/auth';\nimport { StorageService } from '@igo2/core/storage';\n\nimport {\n AuthFeature,\n AuthFeatureKind,\n AuthInterceptor,\n AuthStorageService\n} from './shared';\n\nexport function provideAuthentification(\n ...features: AuthFeature<AuthFeatureKind>[]\n): EnvironmentProviders {\n const providers: Provider[] = [\n {\n provide: HTTP_INTERCEPTORS,\n useClass: AuthInterceptor,\n multi: true\n },\n {\n provide: XHR_INTERCEPTOR,\n useExisting: AuthInterceptor\n },\n {\n provide: StorageService,\n useClass: AuthStorageService\n }\n ];\n\n for (const feature of features) {\n providers.push(...feature.providers);\n }\n\n return makeEnvironmentProviders(providers);\n}\n","/*\n * Public API Surface of auth\n */\nexport * from './lib/auth.provider';\nexport * from './lib/shared';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["tap"],"mappings":";;;;;;;;;;;;;;;;MAYa,YAAY,CAAA;AACf,IAAA,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;AAE3B,IAAA,OAAO;AACP,IAAA,QAAQ;AAEhB,IAAA,WAAA,GAAA;QACE,MAAM,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAgB,aAAa,CAAC;QAC9D,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC;QACvC,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,OAAO,EAAE,QAAQ,IAAI,EAAE;IAC9C;AAEA,IAAA,GAAG,CAAC,KAAa,EAAA;QACf,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE,KAAK,CAAC;IAC5C;IAEA,MAAM,GAAA;AACJ,QAAA,YAAY,CAAC,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC;IACxC;IAEA,GAAG,GAAA;QACD,OAAO,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,SAAS;IACzD;IAEA,MAAM,GAAA;AACJ,QAAA,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,EAAE;QACxB,IAAI,CAAC,KAAK,EAAE;YACV;QACF;AACA,QAAA,OAAO,SAAS,CAAC,KAAK,CAAyB;IACjD;IAEA,SA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": "21.0.0-next.21",
4
4
  "description": "IGO Library",
5
5
  "author": "IGO Community",
6
6
  "keywords": [
@@ -25,18 +25,12 @@
25
25
  "types": "./types/igo2-auth-environment.d.ts",
26
26
  "default": "./fesm2022/igo2-auth-environment.mjs"
27
27
  },
28
- "./facebook": {
29
- "types": "./types/igo2-auth-facebook.d.ts",
30
- "default": "./fesm2022/igo2-auth-facebook.mjs"
31
- },
28
+ "./facebook": {},
32
29
  "./form": {
33
30
  "types": "./types/igo2-auth-form.d.ts",
34
31
  "default": "./fesm2022/igo2-auth-form.mjs"
35
32
  },
36
- "./google": {
37
- "types": "./types/igo2-auth-google.d.ts",
38
- "default": "./fesm2022/igo2-auth-google.mjs"
39
- },
33
+ "./google": {},
40
34
  "./internal": {
41
35
  "types": "./types/igo2-auth-internal.d.ts",
42
36
  "default": "./fesm2022/igo2-auth-internal.mjs"
@@ -65,9 +59,9 @@
65
59
  "@angular/router": "^21.0.0",
66
60
  "@azure/msal-angular": "^5.0.0",
67
61
  "@azure/msal-browser": "^5.0.0",
68
- "@igo2/common": "^21.0.0-next.2",
69
- "@igo2/core": "^21.0.0-next.2",
70
- "@igo2/utils": "^21.0.0-next.2",
62
+ "@igo2/common": "^21.0.0-next.21",
63
+ "@igo2/core": "^21.0.0-next.21",
64
+ "@igo2/utils": "^21.0.0-next.21",
71
65
  "jwt-decode": "^4.0.0",
72
66
  "rxjs": "^7.8.0",
73
67
  "ts-cacheable": "^1.0.6",
@@ -1,8 +1,4 @@
1
- import * as i13 from '@igo2/auth/facebook';
2
- import { AuthFacebookOptions } from '@igo2/auth/facebook';
3
- import * as i11 from '@igo2/auth/google';
4
- import { AuthGoogleOptions } from '@igo2/auth/google';
5
- import * as i14 from '@igo2/auth/microsoft';
1
+ import * as i12 from '@igo2/auth/microsoft';
6
2
  import { AuthMicrosoftOptions, AuthMicrosoftb2cOptions } from '@igo2/auth/microsoft';
7
3
  import * as i0 from '@angular/core';
8
4
  import { OnInit } from '@angular/core';
@@ -16,11 +12,9 @@ import * as i7 from '@angular/material/button';
16
12
  import * as i8 from '@igo2/core/language';
17
13
  import * as i9 from '@azure/msal-angular';
18
14
  import { AuthService, AuthOptions } from '@igo2/auth';
19
- import * as i12 from '@igo2/auth/internal';
15
+ import * as i11 from '@igo2/auth/internal';
20
16
 
21
17
  interface AuthFormOptions {
22
- facebook?: AuthFacebookOptions;
23
- google?: AuthGoogleOptions;
24
18
  microsoft?: AuthMicrosoftOptions;
25
19
  microsoftb2c?: AuthMicrosoftb2cOptions;
26
20
  }
@@ -49,7 +43,7 @@ declare class AuthFormComponent implements OnInit {
49
43
  options?: AuthOptions & AuthFormOptions;
50
44
  user: any;
51
45
  visible: boolean;
52
- private isLogoutRoute;
46
+ private isLogoutRoute?;
53
47
  constructor();
54
48
  ngOnInit(): void;
55
49
  onLogin(): void;
@@ -63,7 +57,7 @@ declare class AuthFormComponent implements OnInit {
63
57
 
64
58
  declare class IgoAuthFormModule {
65
59
  static ɵfac: i0.ɵɵFactoryDeclaration<IgoAuthFormModule, never>;
66
- static ɵmod: i0.ɵɵNgModuleDeclaration<IgoAuthFormModule, never, [typeof i1.CommonModule, typeof i2.ReactiveFormsModule, typeof i3.MatFormFieldModule, typeof i4.MatInputModule, typeof i5.MatIconModule, typeof i6.MatProgressSpinnerModule, typeof i7.MatButtonModule, typeof i8.IgoLanguageModule, typeof i9.MsalModule, typeof AuthFormComponent, typeof i11.AuthGoogleComponent, typeof i12.AuthInternComponent, typeof i13.AuthFacebookComponent, typeof i14.AuthMicrosoftComponent, typeof i14.AuthMicrosoftb2cComponent], [typeof AuthFormComponent]>;
60
+ static ɵmod: i0.ɵɵNgModuleDeclaration<IgoAuthFormModule, never, [typeof i1.CommonModule, typeof i2.ReactiveFormsModule, typeof i3.MatFormFieldModule, typeof i4.MatInputModule, typeof i5.MatIconModule, typeof i6.MatProgressSpinnerModule, typeof i7.MatButtonModule, typeof i8.IgoLanguageModule, typeof i9.MsalModule, typeof AuthFormComponent, typeof i11.AuthInternComponent, typeof i12.AuthMicrosoftComponent, typeof i12.AuthMicrosoftb2cComponent], [typeof AuthFormComponent]>;
67
61
  static ɵinj: i0.ɵɵInjectorDeclaration<IgoAuthFormModule>;
68
62
  }
69
63
 
@@ -43,7 +43,7 @@ interface AuthMicrosoftOptions extends BrowserAuthOptions {
43
43
  }
44
44
  interface AuthMicrosoftb2cOptions {
45
45
  enabled?: boolean;
46
- browserAuthOptions?: BrowserAuthOptions;
46
+ browserAuthOptions: BrowserAuthOptions;
47
47
  options?: AuthMicrosoftb2cOptionsOptions;
48
48
  scopes?: string[];
49
49
  }
@@ -73,8 +73,8 @@ interface MsalGuardConfigurationWithType extends MsalGuardConfiguration {
73
73
  }
74
74
 
75
75
  declare const AUTH_MICROSOFT_DIRECTIVES: readonly [typeof AuthMicrosoftComponent, typeof AuthMicrosoftb2cComponent];
76
- declare function MSALConfigFactory(config: ConfigService): IPublicClientApplication;
77
- declare function MSALConfigFactoryb2c(config: ConfigService): PublicClientApplication;
76
+ declare function MSALConfigFactory(config: ConfigService): IPublicClientApplication | undefined;
77
+ declare function MSALConfigFactoryb2c(config: ConfigService): PublicClientApplication | undefined;
78
78
  declare function MSALAngularConfigFactory(config: ConfigService): MsalGuardConfigurationWithType;
79
79
  declare function MSALAngularConfigFactoryb2c(config: ConfigService): MsalGuardConfigurationWithType;
80
80
  declare function withMicrosoftSupport(type?: string, serviceFactory?: IMsalServiceFactory): AuthFeature<AuthFeatureKind.Microsoft>;
@@ -89,7 +89,7 @@ declare class AuthMsalService extends AuthService<IAuthMsalOptions> {
89
89
  private _isInitialized$;
90
90
  autoLogin: boolean;
91
91
  constructor();
92
- login(): Observable<IUser>;
92
+ login(): Observable<IUser | null>;
93
93
  logout(): void;
94
94
  private getConf;
95
95
  static ɵfac: i0.ɵɵFactoryDeclaration<AuthMsalService, never>;