@osovitny/anatoly 3.16.16 → 3.16.18
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/esm2022/lib/anatoly.module.mjs +15 -1
- package/esm2022/lib/core/services/appcontext.service.mjs +14 -2
- package/esm2022/lib/core/services/starter.service.mjs +9 -4
- package/esm2022/lib/iam/b2c/b2c.mjs +43 -0
- package/esm2022/lib/iam/b2c/consts.mjs +25 -0
- package/esm2022/lib/iam/b2c/index.mjs +21 -0
- package/esm2022/lib/iam/configs.mjs +107 -0
- package/esm2022/lib/iam/consts.mjs +23 -0
- package/esm2022/lib/iam/guards/admin.guard.mjs +47 -0
- package/esm2022/lib/iam/guards/authentication.guard.mjs +31 -0
- package/esm2022/lib/iam/guards/index.mjs +20 -0
- package/esm2022/lib/iam/iam-pages.module.mjs +54 -0
- package/esm2022/lib/iam/iam-pages.routes.mjs +45 -0
- package/esm2022/lib/iam/iam.module.mjs +100 -0
- package/esm2022/lib/iam/index.mjs +18 -0
- package/esm2022/lib/iam/pages/signin.page.mjs +40 -0
- package/esm2022/lib/iam/pages/signout.page.mjs +40 -0
- package/esm2022/lib/iam/pages/signup.page.mjs +39 -0
- package/esm2022/lib/iam/redirect.mjs +29 -0
- package/esm2022/lib/iam/services/auth.service.mjs +246 -0
- package/esm2022/lib/iam/storage.mjs +39 -0
- package/esm2022/public-api.mjs +5 -1
- package/fesm2022/osovitny-anatoly.mjs +934 -7
- package/fesm2022/osovitny-anatoly.mjs.map +1 -1
- package/lib/anatoly.module.d.ts +3 -2
- package/lib/core/services/appcontext.service.d.ts +2 -0
- package/lib/iam/b2c/b2c.d.ts +5 -0
- package/lib/iam/b2c/consts.d.ts +6 -0
- package/lib/iam/b2c/index.d.ts +2 -0
- package/lib/iam/configs.d.ts +5 -0
- package/lib/iam/consts.d.ts +3 -0
- package/lib/iam/guards/admin.guard.d.ts +13 -0
- package/lib/iam/guards/authentication.guard.d.ts +13 -0
- package/lib/iam/guards/index.d.ts +2 -0
- package/lib/iam/iam-pages.module.d.ts +12 -0
- package/lib/iam/iam-pages.routes.d.ts +6 -0
- package/lib/iam/iam.module.d.ts +9 -0
- package/lib/iam/index.d.ts +1 -0
- package/lib/iam/pages/signin.page.d.ts +11 -0
- package/lib/iam/pages/signout.page.d.ts +11 -0
- package/lib/iam/pages/signup.page.d.ts +11 -0
- package/lib/iam/redirect.d.ts +3 -0
- package/lib/iam/services/auth.service.d.ts +37 -0
- package/lib/iam/storage.d.ts +8 -0
- package/package.json +1 -1
- package/public-api.d.ts +3 -0
|
@@ -4,9 +4,9 @@ import { Injectable, EventEmitter, Output, Pipe, APP_INITIALIZER, Injector, NgMo
|
|
|
4
4
|
import * as i1 from '@angular/router';
|
|
5
5
|
import { NavigationEnd, NavigationStart, NavigationCancel, NavigationError, RouterModule } from '@angular/router';
|
|
6
6
|
import * as i1$3 from '@angular/common/http';
|
|
7
|
-
import { HttpResponse, HttpClientModule, HttpClient } from '@angular/common/http';
|
|
7
|
+
import { HttpResponse, HttpClientModule, HttpClient, HTTP_INTERCEPTORS } from '@angular/common/http';
|
|
8
8
|
import { tap, map } from 'rxjs/operators';
|
|
9
|
-
import { BehaviorSubject, Subject, timer, merge, fromEvent, of, forkJoin } from 'rxjs';
|
|
9
|
+
import { BehaviorSubject, Subject, timer, merge, fromEvent, of, forkJoin, filter, takeUntil, map as map$1, catchError } from 'rxjs';
|
|
10
10
|
import { isValid, format, formatDistance, formatDistanceToNow } from 'date-fns';
|
|
11
11
|
import { utcToZonedTime } from 'date-fns-tz';
|
|
12
12
|
import enUS from 'date-fns/locale/en-US';
|
|
@@ -20,6 +20,9 @@ import * as i1$2 from 'ngx-toastr';
|
|
|
20
20
|
import { ToastrModule } from 'ngx-toastr';
|
|
21
21
|
import * as i1$4 from '@angular/platform-browser';
|
|
22
22
|
import { v4 } from 'uuid';
|
|
23
|
+
import * as i4 from '@azure/msal-angular';
|
|
24
|
+
import { MSAL_GUARD_CONFIG, MsalGuard, MsalInterceptor, MSAL_INTERCEPTOR_CONFIG, MSAL_INSTANCE, MsalService, MsalBroadcastService, MsalModule } from '@azure/msal-angular';
|
|
25
|
+
import { EventType, InteractionStatus, InteractionType, InteractionRequiredAuthError, PublicClientApplication, LogLevel } from '@azure/msal-browser';
|
|
23
26
|
import * as i1$6 from '@fortawesome/angular-fontawesome';
|
|
24
27
|
import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
|
|
25
28
|
import * as i1$7 from '@progress/kendo-angular-pager';
|
|
@@ -1526,7 +1529,7 @@ class AppContextService extends ApiServiceBase {
|
|
|
1526
1529
|
this.clearLocalStorage();
|
|
1527
1530
|
this.clearSessionStorage();
|
|
1528
1531
|
}
|
|
1529
|
-
//
|
|
1532
|
+
//current
|
|
1530
1533
|
get current() {
|
|
1531
1534
|
this.updateCurrentIfExpired();
|
|
1532
1535
|
return this.getCurrentFromSession();
|
|
@@ -1534,6 +1537,18 @@ class AppContextService extends ApiServiceBase {
|
|
|
1534
1537
|
set current(value) {
|
|
1535
1538
|
this.setCurrentFromSession(value);
|
|
1536
1539
|
}
|
|
1540
|
+
//currentUser
|
|
1541
|
+
get currentUser() {
|
|
1542
|
+
let current = this.current;
|
|
1543
|
+
return current?.User;
|
|
1544
|
+
}
|
|
1545
|
+
set currentUser(value) {
|
|
1546
|
+
let current = this.current;
|
|
1547
|
+
if (current) {
|
|
1548
|
+
current.User = value;
|
|
1549
|
+
this.current = current;
|
|
1550
|
+
}
|
|
1551
|
+
}
|
|
1537
1552
|
static ɵfac = function AppContextService_Factory(t) { return new (t || AppContextService)(i0.ɵɵinject(i1$3.HttpClient), i0.ɵɵinject(LocalStorageService), i0.ɵɵinject(SessionStorageService)); };
|
|
1538
1553
|
static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: AppContextService, factory: AppContextService.ɵfac });
|
|
1539
1554
|
}
|
|
@@ -1888,9 +1903,14 @@ class StarterServiceBase extends ApiServiceBase {
|
|
|
1888
1903
|
parallelTasks.push(requiredItems$);
|
|
1889
1904
|
let parallelTasks$ = merge(...parallelTasks);
|
|
1890
1905
|
let tasks$ = forkJoin([applicationStarting$, parallelTasks$]);
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1906
|
+
/*
|
|
1907
|
+
VadimOS:
|
|
1908
|
+
concat is NOT wokring here, no idea why. Just executing first task
|
|
1909
|
+
let tasks$ = concat(applicationStarting$, parallelTasks$);
|
|
1910
|
+
|
|
1911
|
+
https://github.com/ReactiveX/rxjs/issues/2427
|
|
1912
|
+
https://github.com/ReactiveX/rxjs/issues/2188
|
|
1913
|
+
*/
|
|
1894
1914
|
//Log
|
|
1895
1915
|
let stopwatch = new Stopwatch("ensureApplicationStarted");
|
|
1896
1916
|
stopwatch.start();
|
|
@@ -2387,6 +2407,346 @@ class EmailsApiService extends ApiServiceBase {
|
|
|
2387
2407
|
*/
|
|
2388
2408
|
//base
|
|
2389
2409
|
|
|
2410
|
+
/*
|
|
2411
|
+
<file>
|
|
2412
|
+
Project:
|
|
2413
|
+
@osovitny/anatoly
|
|
2414
|
+
|
|
2415
|
+
Authors:
|
|
2416
|
+
Vadim Osovitny vadim@osovitny.com
|
|
2417
|
+
Anatoly Osovitny anatoly@osovitny.com
|
|
2418
|
+
|
|
2419
|
+
Created:
|
|
2420
|
+
20 Sep 2023
|
|
2421
|
+
|
|
2422
|
+
Description:
|
|
2423
|
+
Identity and Access Management
|
|
2424
|
+
|
|
2425
|
+
Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
|
|
2426
|
+
</file>
|
|
2427
|
+
*/
|
|
2428
|
+
let msalSettings = document.getElementById("msalSettings").getAttribute('data-msalsettings');
|
|
2429
|
+
let MSALConfig = JSON.parse(msalSettings);
|
|
2430
|
+
let MSALApiConfig = MSALConfig?.api;
|
|
2431
|
+
let MSALB2CConfig = MSALConfig?.b2c;
|
|
2432
|
+
|
|
2433
|
+
/*
|
|
2434
|
+
<file>
|
|
2435
|
+
Project:
|
|
2436
|
+
@osovitny/anatoly
|
|
2437
|
+
|
|
2438
|
+
Authors:
|
|
2439
|
+
Vadim Osovitny vadim@osovitny.com
|
|
2440
|
+
Anatoly Osovitny anatoly@osovitny.com
|
|
2441
|
+
|
|
2442
|
+
Created:
|
|
2443
|
+
20 Sep 2023
|
|
2444
|
+
|
|
2445
|
+
Description:
|
|
2446
|
+
Identity and Access Management
|
|
2447
|
+
|
|
2448
|
+
Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
|
|
2449
|
+
</file>
|
|
2450
|
+
*/
|
|
2451
|
+
const MSALStorageKeys = {
|
|
2452
|
+
//LocalStorage
|
|
2453
|
+
redirectTo: 'msal.app.redirectTo'
|
|
2454
|
+
//SessionStorage
|
|
2455
|
+
};
|
|
2456
|
+
class MSALStorage {
|
|
2457
|
+
static saveRedirectState(redirectTo, calledBy) {
|
|
2458
|
+
localStorage.setItem(MSALStorageKeys.redirectTo, redirectTo);
|
|
2459
|
+
console.log(`msal.app: redirect state saved: ${redirectTo}. Called by: ${calledBy}`);
|
|
2460
|
+
}
|
|
2461
|
+
static getRedirectState(calledBy) {
|
|
2462
|
+
let redirectTo = localStorage.getItem(MSALStorageKeys.redirectTo);
|
|
2463
|
+
console.log(`msal.app: redirect state requested: ${redirectTo}. Called by: ${calledBy}`);
|
|
2464
|
+
return redirectTo;
|
|
2465
|
+
}
|
|
2466
|
+
static clearRedirectState(calledBy) {
|
|
2467
|
+
localStorage.removeItem(MSALStorageKeys.redirectTo);
|
|
2468
|
+
console.log(`msal.app: redirect state cleared. Called by: ${calledBy}`);
|
|
2469
|
+
}
|
|
2470
|
+
}
|
|
2471
|
+
|
|
2472
|
+
/*
|
|
2473
|
+
<file>
|
|
2474
|
+
Project:
|
|
2475
|
+
@osovitny/anatoly
|
|
2476
|
+
|
|
2477
|
+
Authors:
|
|
2478
|
+
Vadim Osovitny vadim@osovitny.com
|
|
2479
|
+
Anatoly Osovitny anatoly@osovitny.com
|
|
2480
|
+
|
|
2481
|
+
Created:
|
|
2482
|
+
20 Sep 2023
|
|
2483
|
+
|
|
2484
|
+
Description:
|
|
2485
|
+
Identity and Access Management
|
|
2486
|
+
|
|
2487
|
+
Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
|
|
2488
|
+
</file>
|
|
2489
|
+
*/
|
|
2490
|
+
class MSALRedirect {
|
|
2491
|
+
static handle(router, calledBy) {
|
|
2492
|
+
let redirectTo = MSALStorage.getRedirectState(calledBy);
|
|
2493
|
+
if (redirectTo) {
|
|
2494
|
+
MSALStorage.clearRedirectState(calledBy);
|
|
2495
|
+
router.navigate([redirectTo]);
|
|
2496
|
+
}
|
|
2497
|
+
}
|
|
2498
|
+
}
|
|
2499
|
+
|
|
2500
|
+
class AuthService extends ApiServiceBase {
|
|
2501
|
+
http;
|
|
2502
|
+
router;
|
|
2503
|
+
appContext;
|
|
2504
|
+
msalGuardConfig;
|
|
2505
|
+
msalService;
|
|
2506
|
+
msalBroadcastService;
|
|
2507
|
+
msalDestroying$ = new Subject();
|
|
2508
|
+
initialized = false;
|
|
2509
|
+
constructor(http, router, appContext, msalGuardConfig, msalService, msalBroadcastService) {
|
|
2510
|
+
super(http);
|
|
2511
|
+
this.http = http;
|
|
2512
|
+
this.router = router;
|
|
2513
|
+
this.appContext = appContext;
|
|
2514
|
+
this.msalGuardConfig = msalGuardConfig;
|
|
2515
|
+
this.msalService = msalService;
|
|
2516
|
+
this.msalBroadcastService = msalBroadcastService;
|
|
2517
|
+
this.init();
|
|
2518
|
+
}
|
|
2519
|
+
ngOnDestroy() {
|
|
2520
|
+
this.msalDestroying$.next(undefined);
|
|
2521
|
+
this.msalDestroying$.complete();
|
|
2522
|
+
}
|
|
2523
|
+
init() {
|
|
2524
|
+
this.setDefaults();
|
|
2525
|
+
this.msalService.initialize().subscribe(() => {
|
|
2526
|
+
this.initialized = true;
|
|
2527
|
+
console.log(`msal.app: initMSAL started`);
|
|
2528
|
+
this.initMSAL();
|
|
2529
|
+
console.log(`msal.app: initMSAL finished`);
|
|
2530
|
+
});
|
|
2531
|
+
}
|
|
2532
|
+
setDefaults() {
|
|
2533
|
+
}
|
|
2534
|
+
initMSAL() {
|
|
2535
|
+
this.msalService.instance.enableAccountStorageEvents();
|
|
2536
|
+
this.msalService.handleRedirectObservable().subscribe({
|
|
2537
|
+
next: (result) => {
|
|
2538
|
+
console.log(`msal.app: handleRedirectObservable`);
|
|
2539
|
+
},
|
|
2540
|
+
error: (error) => {
|
|
2541
|
+
console.log(error);
|
|
2542
|
+
}
|
|
2543
|
+
});
|
|
2544
|
+
this.msalBroadcastService.msalSubject$
|
|
2545
|
+
.pipe(filter((msg) => msg.eventType === EventType.INITIALIZE_END ||
|
|
2546
|
+
msg.eventType === EventType.ACCOUNT_ADDED ||
|
|
2547
|
+
msg.eventType === EventType.ACCOUNT_REMOVED ||
|
|
2548
|
+
msg.eventType === EventType.LOGIN_SUCCESS ||
|
|
2549
|
+
msg.eventType === EventType.LOGIN_FAILURE ||
|
|
2550
|
+
msg.eventType === EventType.LOGOUT_SUCCESS ||
|
|
2551
|
+
msg.eventType === EventType.LOGOUT_FAILURE), takeUntil(this.msalDestroying$))
|
|
2552
|
+
.subscribe((msg) => {
|
|
2553
|
+
switch (msg.eventType) {
|
|
2554
|
+
case EventType.INITIALIZE_END:
|
|
2555
|
+
console.log(`msal.app: INITIALIZE_END fired`);
|
|
2556
|
+
break;
|
|
2557
|
+
case EventType.ACCOUNT_ADDED:
|
|
2558
|
+
case EventType.LOGIN_SUCCESS:
|
|
2559
|
+
let payload = msg.payload;
|
|
2560
|
+
if (payload) {
|
|
2561
|
+
this.msalService.instance.setActiveAccount(payload.account);
|
|
2562
|
+
}
|
|
2563
|
+
break;
|
|
2564
|
+
case EventType.ACCOUNT_REMOVED:
|
|
2565
|
+
if (this.msalService.instance.getAllAccounts().length === 0) {
|
|
2566
|
+
window.location.pathname = "/";
|
|
2567
|
+
}
|
|
2568
|
+
break;
|
|
2569
|
+
}
|
|
2570
|
+
});
|
|
2571
|
+
this.msalBroadcastService.inProgress$
|
|
2572
|
+
.pipe(filter((status) => status === InteractionStatus.Startup ||
|
|
2573
|
+
status === InteractionStatus.None), takeUntil(this.msalDestroying$))
|
|
2574
|
+
.subscribe((status) => {
|
|
2575
|
+
switch (status) {
|
|
2576
|
+
/**
|
|
2577
|
+
* Initial status before interaction occurs
|
|
2578
|
+
*/
|
|
2579
|
+
case InteractionStatus.Startup:
|
|
2580
|
+
console.log(`msal.app: InteractionStatus.Startup`);
|
|
2581
|
+
break;
|
|
2582
|
+
/**
|
|
2583
|
+
* Status set when interaction is complete
|
|
2584
|
+
*/
|
|
2585
|
+
case InteractionStatus.None:
|
|
2586
|
+
console.log(`msal.app: InteractionStatus.None`);
|
|
2587
|
+
MSALRedirect.handle(this.router, 'msalBroadcastService.inProgress$ InteractionStatus.None');
|
|
2588
|
+
this.checkAndSetActiveAccount();
|
|
2589
|
+
break;
|
|
2590
|
+
}
|
|
2591
|
+
});
|
|
2592
|
+
}
|
|
2593
|
+
getActiveAccount() {
|
|
2594
|
+
this.checkAndSetActiveAccount();
|
|
2595
|
+
return this.msalService.instance.getActiveAccount();
|
|
2596
|
+
}
|
|
2597
|
+
checkAndSetActiveAccount() {
|
|
2598
|
+
let activeAccount = this.msalService.instance.getActiveAccount();
|
|
2599
|
+
let accounts = this.msalService.instance.getAllAccounts();
|
|
2600
|
+
if (!activeAccount && accounts.length > 0) {
|
|
2601
|
+
this.msalService.instance.setActiveAccount(accounts[0]);
|
|
2602
|
+
}
|
|
2603
|
+
}
|
|
2604
|
+
isPopup(popup) {
|
|
2605
|
+
if (typeof popup === "undefined") {
|
|
2606
|
+
return this.msalGuardConfig.interactionType === InteractionType.Popup;
|
|
2607
|
+
}
|
|
2608
|
+
return popup;
|
|
2609
|
+
}
|
|
2610
|
+
acquireToken() {
|
|
2611
|
+
let request = {
|
|
2612
|
+
scopes: MSALApiConfig.scopes
|
|
2613
|
+
};
|
|
2614
|
+
if (this.isPopup()) {
|
|
2615
|
+
return this.msalService.acquireTokenPopup(request).pipe(map$1(response => {
|
|
2616
|
+
return response ? response.accessToken : null;
|
|
2617
|
+
}));
|
|
2618
|
+
}
|
|
2619
|
+
else {
|
|
2620
|
+
return this.msalService.acquireTokenRedirect(request).pipe(map$1(() => {
|
|
2621
|
+
return null;
|
|
2622
|
+
}));
|
|
2623
|
+
}
|
|
2624
|
+
}
|
|
2625
|
+
getUserEmail() {
|
|
2626
|
+
let currentUser = this.appContext.currentUser;
|
|
2627
|
+
let activeAccount = this.getActiveAccount();
|
|
2628
|
+
if (activeAccount) {
|
|
2629
|
+
return activeAccount.username;
|
|
2630
|
+
}
|
|
2631
|
+
return currentUser ? currentUser.Email : '';
|
|
2632
|
+
}
|
|
2633
|
+
getUserName() {
|
|
2634
|
+
let currentUser = this.appContext.currentUser;
|
|
2635
|
+
let activeAccount = this.getActiveAccount();
|
|
2636
|
+
if (activeAccount) {
|
|
2637
|
+
return activeAccount.name ? activeAccount.name : currentUser ? currentUser.displayNameOrFullName : '';
|
|
2638
|
+
}
|
|
2639
|
+
return currentUser ? currentUser.displayNameOrFullName : '';
|
|
2640
|
+
}
|
|
2641
|
+
/*
|
|
2642
|
+
VadimOS:
|
|
2643
|
+
WARNING to all developers! Be sure that you really need to directly call this method!
|
|
2644
|
+
*/
|
|
2645
|
+
getAccessToken(requestUrl) {
|
|
2646
|
+
let activeAccount = this.getActiveAccount();
|
|
2647
|
+
let silentRequest = {
|
|
2648
|
+
scopes: MSALApiConfig.scopes,
|
|
2649
|
+
account: activeAccount
|
|
2650
|
+
};
|
|
2651
|
+
if (activeAccount) {
|
|
2652
|
+
return this.msalService.acquireTokenSilent(silentRequest).pipe(map$1(response => {
|
|
2653
|
+
return response.accessToken;
|
|
2654
|
+
}), catchError(error => {
|
|
2655
|
+
console.log("Silent token acquisition fails.");
|
|
2656
|
+
if (error instanceof InteractionRequiredAuthError) {
|
|
2657
|
+
return this.acquireToken();
|
|
2658
|
+
}
|
|
2659
|
+
return of(null);
|
|
2660
|
+
}));
|
|
2661
|
+
}
|
|
2662
|
+
return this.acquireToken();
|
|
2663
|
+
}
|
|
2664
|
+
login(popup) {
|
|
2665
|
+
let authRequest = this.msalGuardConfig.authRequest;
|
|
2666
|
+
if (this.isPopup(popup)) {
|
|
2667
|
+
if (authRequest) {
|
|
2668
|
+
return this.msalService.loginPopup({ ...authRequest }).pipe(map$1((response) => {
|
|
2669
|
+
this.msalService.instance.setActiveAccount(response.account);
|
|
2670
|
+
}));
|
|
2671
|
+
}
|
|
2672
|
+
else {
|
|
2673
|
+
return this.msalService.loginPopup().pipe(map$1((response) => {
|
|
2674
|
+
this.msalService.instance.setActiveAccount(response.account);
|
|
2675
|
+
}));
|
|
2676
|
+
}
|
|
2677
|
+
}
|
|
2678
|
+
else {
|
|
2679
|
+
if (authRequest) {
|
|
2680
|
+
return this.msalService.loginRedirect({ ...authRequest });
|
|
2681
|
+
}
|
|
2682
|
+
else {
|
|
2683
|
+
return this.msalService.loginRedirect();
|
|
2684
|
+
}
|
|
2685
|
+
}
|
|
2686
|
+
}
|
|
2687
|
+
logout(popup) {
|
|
2688
|
+
let activeAccount = this.getActiveAccount();
|
|
2689
|
+
if (!activeAccount) {
|
|
2690
|
+
return of(null);
|
|
2691
|
+
}
|
|
2692
|
+
if (this.isPopup(popup)) {
|
|
2693
|
+
return this.msalService.logoutPopup({ account: activeAccount, mainWindowRedirectUri: "/" }).pipe(map$1(() => {
|
|
2694
|
+
this.appContext.clearWebStorage();
|
|
2695
|
+
}));
|
|
2696
|
+
}
|
|
2697
|
+
else {
|
|
2698
|
+
return this.msalService.logoutRedirect({ account: activeAccount }).pipe(map$1(() => {
|
|
2699
|
+
this.appContext.clearWebStorage();
|
|
2700
|
+
}));
|
|
2701
|
+
}
|
|
2702
|
+
}
|
|
2703
|
+
isUserAuthenticated() {
|
|
2704
|
+
return this.msalService.instance.getActiveAccount() != null;
|
|
2705
|
+
}
|
|
2706
|
+
isUserSignedIn() {
|
|
2707
|
+
if (!this.isUserAuthenticated()) {
|
|
2708
|
+
return false;
|
|
2709
|
+
}
|
|
2710
|
+
let currentUser = this.appContext.currentUser;
|
|
2711
|
+
return currentUser && currentUser.UserID;
|
|
2712
|
+
}
|
|
2713
|
+
isUserAdmin() {
|
|
2714
|
+
if (!this.isUserSignedIn()) {
|
|
2715
|
+
return false;
|
|
2716
|
+
}
|
|
2717
|
+
let currentUser = this.appContext.currentUser;
|
|
2718
|
+
return currentUser && currentUser.isUserAdmin;
|
|
2719
|
+
}
|
|
2720
|
+
static ɵfac = function AuthService_Factory(t) { return new (t || AuthService)(i0.ɵɵinject(i1$3.HttpClient), i0.ɵɵinject(i1.Router), i0.ɵɵinject(AppContextService), i0.ɵɵinject(MSAL_GUARD_CONFIG), i0.ɵɵinject(i4.MsalService), i0.ɵɵinject(i4.MsalBroadcastService)); };
|
|
2721
|
+
static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: AuthService, factory: AuthService.ɵfac, providedIn: 'root' });
|
|
2722
|
+
}
|
|
2723
|
+
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(AuthService, [{
|
|
2724
|
+
type: Injectable,
|
|
2725
|
+
args: [{
|
|
2726
|
+
providedIn: 'root'
|
|
2727
|
+
}]
|
|
2728
|
+
}], function () { return [{ type: i1$3.HttpClient }, { type: i1.Router }, { type: AppContextService }, { type: undefined, decorators: [{
|
|
2729
|
+
type: Inject,
|
|
2730
|
+
args: [MSAL_GUARD_CONFIG]
|
|
2731
|
+
}] }, { type: i4.MsalService }, { type: i4.MsalBroadcastService }]; }, null); })();
|
|
2732
|
+
|
|
2733
|
+
/*
|
|
2734
|
+
<file>
|
|
2735
|
+
Project:
|
|
2736
|
+
@osovitny/anatoly
|
|
2737
|
+
|
|
2738
|
+
Authors:
|
|
2739
|
+
Vadim Osovitny vadim@osovitny.com
|
|
2740
|
+
Anatoly Osovitny anatoly@osovitny.com
|
|
2741
|
+
|
|
2742
|
+
Created:
|
|
2743
|
+
27 Nov 2023
|
|
2744
|
+
|
|
2745
|
+
Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
|
|
2746
|
+
</file>
|
|
2747
|
+
*/
|
|
2748
|
+
//services
|
|
2749
|
+
|
|
2390
2750
|
/*
|
|
2391
2751
|
<file>
|
|
2392
2752
|
Project:
|
|
@@ -5464,6 +5824,561 @@ class AnatolyDataModule {
|
|
|
5464
5824
|
}], null, null); })();
|
|
5465
5825
|
(function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(AnatolyDataModule, { imports: [CommonModule] }); })();
|
|
5466
5826
|
|
|
5827
|
+
/*
|
|
5828
|
+
<file>
|
|
5829
|
+
Project:
|
|
5830
|
+
@osovitny/anatoly
|
|
5831
|
+
|
|
5832
|
+
Authors:
|
|
5833
|
+
Vadim Osovitny vadim@osovitny.com
|
|
5834
|
+
Anatoly Osovitny anatoly@osovitny.com
|
|
5835
|
+
|
|
5836
|
+
Created:
|
|
5837
|
+
20 Sep 2023
|
|
5838
|
+
|
|
5839
|
+
Description:
|
|
5840
|
+
Identity and Access Management
|
|
5841
|
+
|
|
5842
|
+
Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
|
|
5843
|
+
</file>
|
|
5844
|
+
*/
|
|
5845
|
+
//App
|
|
5846
|
+
class MSALB2C {
|
|
5847
|
+
static isEnabled() {
|
|
5848
|
+
if (MSALB2CConfig) {
|
|
5849
|
+
return true;
|
|
5850
|
+
}
|
|
5851
|
+
return false;
|
|
5852
|
+
}
|
|
5853
|
+
static getAuthorityByType(type) {
|
|
5854
|
+
let policy = MSALB2C.getPolicyByType(type);
|
|
5855
|
+
return policy?.authority;
|
|
5856
|
+
}
|
|
5857
|
+
static getPolicyByType(type) {
|
|
5858
|
+
let policies = MSALB2CConfig.policies;
|
|
5859
|
+
for (let i = 0; i < policies.length; i++) {
|
|
5860
|
+
let policy = policies[i];
|
|
5861
|
+
if (policy.type == type) {
|
|
5862
|
+
return policy;
|
|
5863
|
+
}
|
|
5864
|
+
}
|
|
5865
|
+
return null;
|
|
5866
|
+
}
|
|
5867
|
+
}
|
|
5868
|
+
|
|
5869
|
+
/*
|
|
5870
|
+
<file>
|
|
5871
|
+
Project:
|
|
5872
|
+
@osovitny/anatoly
|
|
5873
|
+
|
|
5874
|
+
Authors:
|
|
5875
|
+
Vadim Osovitny vadim@osovitny.com
|
|
5876
|
+
Anatoly Osovitny anatoly@osovitny.com
|
|
5877
|
+
|
|
5878
|
+
Created:
|
|
5879
|
+
20 Sep 2023
|
|
5880
|
+
|
|
5881
|
+
Description:
|
|
5882
|
+
Identity and Access Management
|
|
5883
|
+
|
|
5884
|
+
Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
|
|
5885
|
+
</file>
|
|
5886
|
+
*/
|
|
5887
|
+
const PolicyType = {
|
|
5888
|
+
signUpSignIn: 'signUpSignIn',
|
|
5889
|
+
signUp: 'signUp',
|
|
5890
|
+
resetPassword: 'resetPassword',
|
|
5891
|
+
editProfile: 'editProfile'
|
|
5892
|
+
};
|
|
5893
|
+
|
|
5894
|
+
/*
|
|
5895
|
+
<file>
|
|
5896
|
+
Project:
|
|
5897
|
+
@osovitny/anatoly
|
|
5898
|
+
|
|
5899
|
+
Authors:
|
|
5900
|
+
Vadim Osovitny vadim@osovitny.com
|
|
5901
|
+
Anatoly Osovitny anatoly@osovitny.com
|
|
5902
|
+
|
|
5903
|
+
Created:
|
|
5904
|
+
20 Sep 2023
|
|
5905
|
+
|
|
5906
|
+
Description:
|
|
5907
|
+
Identity and Access Management
|
|
5908
|
+
|
|
5909
|
+
Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
|
|
5910
|
+
</file>
|
|
5911
|
+
*/
|
|
5912
|
+
|
|
5913
|
+
/*
|
|
5914
|
+
<file>
|
|
5915
|
+
Project:
|
|
5916
|
+
@osovitny/anatoly
|
|
5917
|
+
|
|
5918
|
+
Authors:
|
|
5919
|
+
Vadim Osovitny vadim@osovitny.com
|
|
5920
|
+
Anatoly Osovitny anatoly@osovitny.com
|
|
5921
|
+
|
|
5922
|
+
Created:
|
|
5923
|
+
2 May 2023
|
|
5924
|
+
|
|
5925
|
+
Description:
|
|
5926
|
+
Identity and Access Management
|
|
5927
|
+
|
|
5928
|
+
Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
|
|
5929
|
+
</file>
|
|
5930
|
+
*/
|
|
5931
|
+
function MSALInterceptorConfigFactory() {
|
|
5932
|
+
let protectedResourceMap = new Map();
|
|
5933
|
+
protectedResourceMap.set('https://graph.microsoft.com/v1.0/me', ['user.read']);
|
|
5934
|
+
return {
|
|
5935
|
+
interactionType: InteractionType.Redirect,
|
|
5936
|
+
protectedResourceMap
|
|
5937
|
+
};
|
|
5938
|
+
}
|
|
5939
|
+
function MSALGuardConfigFactory() {
|
|
5940
|
+
return {
|
|
5941
|
+
interactionType: InteractionType.Redirect,
|
|
5942
|
+
authRequest: (authService, state) => {
|
|
5943
|
+
let scopes = MSALApiConfig.scopes;
|
|
5944
|
+
let redirectTo = state.url;
|
|
5945
|
+
/*
|
|
5946
|
+
VadimOS: not working for some reason
|
|
5947
|
+
|
|
5948
|
+
let stateData = {
|
|
5949
|
+
redirectTo: redirectTo
|
|
5950
|
+
};
|
|
5951
|
+
let state64 = Buffer.from(JSON.stringify(stateData)).toString('base64');
|
|
5952
|
+
let request: RedirectRequest = {
|
|
5953
|
+
scopes: [...scopes],
|
|
5954
|
+
state: state64,
|
|
5955
|
+
redirectStartPage: redirectTo
|
|
5956
|
+
}
|
|
5957
|
+
*/
|
|
5958
|
+
let request = {
|
|
5959
|
+
scopes: [...scopes]
|
|
5960
|
+
};
|
|
5961
|
+
MSALStorage.saveRedirectState(redirectTo, 'MSALGuardConfigFactory.authRequest');
|
|
5962
|
+
return request;
|
|
5963
|
+
}
|
|
5964
|
+
};
|
|
5965
|
+
}
|
|
5966
|
+
function MSALInstanceFactory() {
|
|
5967
|
+
let authority = MSALConfig.app.auth.authority;
|
|
5968
|
+
let configuration = {
|
|
5969
|
+
auth: {
|
|
5970
|
+
authority: authority,
|
|
5971
|
+
clientId: MSALConfig.app.auth.clientId,
|
|
5972
|
+
redirectUri: MSALConfig.app.auth.redirectUri,
|
|
5973
|
+
postLogoutRedirectUri: MSALConfig.app.auth.postLogoutRedirectUri,
|
|
5974
|
+
navigateToLoginRequestUrl: MSALConfig.app.auth.navigateToLoginRequestUrl
|
|
5975
|
+
},
|
|
5976
|
+
cache: {
|
|
5977
|
+
cacheLocation: MSALConfig.app.cache.cacheLocation,
|
|
5978
|
+
storeAuthStateInCookie: MSALConfig.app.cache.storeAuthStateInCookie
|
|
5979
|
+
},
|
|
5980
|
+
system: {
|
|
5981
|
+
allowNativeBroker: false,
|
|
5982
|
+
loggerOptions: {
|
|
5983
|
+
loggerCallback,
|
|
5984
|
+
logLevel: MSALConfig.app.system.loggerOptions.logLevel,
|
|
5985
|
+
piiLoggingEnabled: false
|
|
5986
|
+
}
|
|
5987
|
+
}
|
|
5988
|
+
};
|
|
5989
|
+
if (MSALB2C.isEnabled()) {
|
|
5990
|
+
configuration.auth.authority = MSALB2C.getAuthorityByType(PolicyType.signUpSignIn);
|
|
5991
|
+
configuration.auth.knownAuthorities = [MSALB2CConfig.authorityDomain];
|
|
5992
|
+
}
|
|
5993
|
+
return new PublicClientApplication(configuration);
|
|
5994
|
+
}
|
|
5995
|
+
function loggerCallback(logLevel, message, containsPii) {
|
|
5996
|
+
if (containsPii) {
|
|
5997
|
+
return;
|
|
5998
|
+
}
|
|
5999
|
+
switch (logLevel) {
|
|
6000
|
+
case LogLevel.Error:
|
|
6001
|
+
console.error(message);
|
|
6002
|
+
return;
|
|
6003
|
+
case LogLevel.Info:
|
|
6004
|
+
console.info(message);
|
|
6005
|
+
return;
|
|
6006
|
+
case LogLevel.Verbose:
|
|
6007
|
+
console.debug(message);
|
|
6008
|
+
return;
|
|
6009
|
+
case LogLevel.Warning:
|
|
6010
|
+
console.warn(message);
|
|
6011
|
+
return;
|
|
6012
|
+
}
|
|
6013
|
+
}
|
|
6014
|
+
|
|
6015
|
+
/*
|
|
6016
|
+
<file>
|
|
6017
|
+
Project:
|
|
6018
|
+
@osovitny/anatoly
|
|
6019
|
+
|
|
6020
|
+
Authors:
|
|
6021
|
+
Vadim Osovitny vadim@osovitny.com
|
|
6022
|
+
Anatoly Osovitny anatoly@osovitny.com
|
|
6023
|
+
|
|
6024
|
+
Created:
|
|
6025
|
+
6 Dec 2018
|
|
6026
|
+
|
|
6027
|
+
Description:
|
|
6028
|
+
Identity and Access Management
|
|
6029
|
+
|
|
6030
|
+
Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
|
|
6031
|
+
</file>
|
|
6032
|
+
*/
|
|
6033
|
+
//Node
|
|
6034
|
+
class AdminGuard {
|
|
6035
|
+
auth;
|
|
6036
|
+
constructor(auth) {
|
|
6037
|
+
this.auth = auth;
|
|
6038
|
+
}
|
|
6039
|
+
isUserAdmin() {
|
|
6040
|
+
return of(this.auth.isUserAdmin());
|
|
6041
|
+
}
|
|
6042
|
+
canActivate(next, state) {
|
|
6043
|
+
return this.isUserAdmin();
|
|
6044
|
+
}
|
|
6045
|
+
canActivateChild(route, state) {
|
|
6046
|
+
if (route.component) {
|
|
6047
|
+
return this.isUserAdmin();
|
|
6048
|
+
}
|
|
6049
|
+
return of(true);
|
|
6050
|
+
}
|
|
6051
|
+
static ɵfac = function AdminGuard_Factory(t) { return new (t || AdminGuard)(i0.ɵɵinject(AuthService)); };
|
|
6052
|
+
static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: AdminGuard, factory: AdminGuard.ɵfac });
|
|
6053
|
+
}
|
|
6054
|
+
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(AdminGuard, [{
|
|
6055
|
+
type: Injectable
|
|
6056
|
+
}], function () { return [{ type: AuthService }]; }, null); })();
|
|
6057
|
+
|
|
6058
|
+
class AuthenticationGuard extends MsalGuard {
|
|
6059
|
+
_msalGuardConfig;
|
|
6060
|
+
constructor(msalGuardConfig, msalBroadcastService, authService, location, router) {
|
|
6061
|
+
super(msalGuardConfig, msalBroadcastService, authService, location, router);
|
|
6062
|
+
this._msalGuardConfig = msalGuardConfig;
|
|
6063
|
+
}
|
|
6064
|
+
setInteractionType(route) {
|
|
6065
|
+
let interactionType = route.data.interactionType;
|
|
6066
|
+
this._msalGuardConfig.interactionType = interactionType || InteractionType.Redirect;
|
|
6067
|
+
}
|
|
6068
|
+
canActivate(route, state) {
|
|
6069
|
+
this.setInteractionType(route);
|
|
6070
|
+
return super.canActivate(route, state);
|
|
6071
|
+
}
|
|
6072
|
+
static ɵfac = function AuthenticationGuard_Factory(t) { return new (t || AuthenticationGuard)(i0.ɵɵinject(MSAL_GUARD_CONFIG), i0.ɵɵinject(i4.MsalBroadcastService), i0.ɵɵinject(i4.MsalService), i0.ɵɵinject(i1$5.Location), i0.ɵɵinject(i1.Router)); };
|
|
6073
|
+
static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: AuthenticationGuard, factory: AuthenticationGuard.ɵfac });
|
|
6074
|
+
}
|
|
6075
|
+
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(AuthenticationGuard, [{
|
|
6076
|
+
type: Injectable
|
|
6077
|
+
}], function () { return [{ type: undefined, decorators: [{
|
|
6078
|
+
type: Inject,
|
|
6079
|
+
args: [MSAL_GUARD_CONFIG]
|
|
6080
|
+
}] }, { type: i4.MsalBroadcastService }, { type: i4.MsalService }, { type: i1$5.Location }, { type: i1.Router }]; }, null); })();
|
|
6081
|
+
|
|
6082
|
+
/*
|
|
6083
|
+
<file>
|
|
6084
|
+
Project:
|
|
6085
|
+
QA
|
|
6086
|
+
|
|
6087
|
+
Authors:
|
|
6088
|
+
Vadim Osovitny vadim@osovitny.com
|
|
6089
|
+
|
|
6090
|
+
Created:
|
|
6091
|
+
6 Dec 2018
|
|
6092
|
+
|
|
6093
|
+
Description:
|
|
6094
|
+
Identity and Access Management
|
|
6095
|
+
|
|
6096
|
+
Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
|
|
6097
|
+
</file>
|
|
6098
|
+
*/
|
|
6099
|
+
|
|
6100
|
+
/*
|
|
6101
|
+
<file>
|
|
6102
|
+
Project:
|
|
6103
|
+
@osovitny/anatoly
|
|
6104
|
+
|
|
6105
|
+
Authors:
|
|
6106
|
+
Vadim Osovitny vadim@osovitny.com
|
|
6107
|
+
Anatoly Osovitny anatoly@osovitny.com
|
|
6108
|
+
|
|
6109
|
+
Created:
|
|
6110
|
+
6 Dec 2018
|
|
6111
|
+
|
|
6112
|
+
Description:
|
|
6113
|
+
Identity and Access Management
|
|
6114
|
+
|
|
6115
|
+
Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
|
|
6116
|
+
</file>
|
|
6117
|
+
*/
|
|
6118
|
+
//Node
|
|
6119
|
+
class AnatolyIAMModule {
|
|
6120
|
+
static ɵfac = function AnatolyIAMModule_Factory(t) { return new (t || AnatolyIAMModule)(); };
|
|
6121
|
+
static ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: AnatolyIAMModule });
|
|
6122
|
+
static ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ providers: [
|
|
6123
|
+
{
|
|
6124
|
+
provide: HTTP_INTERCEPTORS,
|
|
6125
|
+
useClass: MsalInterceptor,
|
|
6126
|
+
multi: true
|
|
6127
|
+
},
|
|
6128
|
+
{
|
|
6129
|
+
provide: MSAL_INTERCEPTOR_CONFIG,
|
|
6130
|
+
useFactory: MSALInterceptorConfigFactory
|
|
6131
|
+
},
|
|
6132
|
+
{
|
|
6133
|
+
provide: MSAL_GUARD_CONFIG,
|
|
6134
|
+
useFactory: MSALGuardConfigFactory
|
|
6135
|
+
},
|
|
6136
|
+
{
|
|
6137
|
+
provide: MSAL_INSTANCE,
|
|
6138
|
+
useFactory: MSALInstanceFactory
|
|
6139
|
+
},
|
|
6140
|
+
MsalService,
|
|
6141
|
+
MsalBroadcastService,
|
|
6142
|
+
//App
|
|
6143
|
+
AuthService,
|
|
6144
|
+
AuthenticationGuard,
|
|
6145
|
+
AdminGuard
|
|
6146
|
+
], imports: [CommonModule,
|
|
6147
|
+
HttpClientModule,
|
|
6148
|
+
MsalModule] });
|
|
6149
|
+
}
|
|
6150
|
+
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(AnatolyIAMModule, [{
|
|
6151
|
+
type: NgModule,
|
|
6152
|
+
args: [{
|
|
6153
|
+
imports: [
|
|
6154
|
+
CommonModule,
|
|
6155
|
+
HttpClientModule,
|
|
6156
|
+
MsalModule
|
|
6157
|
+
],
|
|
6158
|
+
exports: [],
|
|
6159
|
+
declarations: [],
|
|
6160
|
+
providers: [
|
|
6161
|
+
{
|
|
6162
|
+
provide: HTTP_INTERCEPTORS,
|
|
6163
|
+
useClass: MsalInterceptor,
|
|
6164
|
+
multi: true
|
|
6165
|
+
},
|
|
6166
|
+
{
|
|
6167
|
+
provide: MSAL_INTERCEPTOR_CONFIG,
|
|
6168
|
+
useFactory: MSALInterceptorConfigFactory
|
|
6169
|
+
},
|
|
6170
|
+
{
|
|
6171
|
+
provide: MSAL_GUARD_CONFIG,
|
|
6172
|
+
useFactory: MSALGuardConfigFactory
|
|
6173
|
+
},
|
|
6174
|
+
{
|
|
6175
|
+
provide: MSAL_INSTANCE,
|
|
6176
|
+
useFactory: MSALInstanceFactory
|
|
6177
|
+
},
|
|
6178
|
+
MsalService,
|
|
6179
|
+
MsalBroadcastService,
|
|
6180
|
+
//App
|
|
6181
|
+
AuthService,
|
|
6182
|
+
AuthenticationGuard,
|
|
6183
|
+
AdminGuard
|
|
6184
|
+
]
|
|
6185
|
+
}]
|
|
6186
|
+
}], null, null); })();
|
|
6187
|
+
(function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(AnatolyIAMModule, { imports: [CommonModule,
|
|
6188
|
+
HttpClientModule,
|
|
6189
|
+
MsalModule] }); })();
|
|
6190
|
+
|
|
6191
|
+
/*
|
|
6192
|
+
<file>
|
|
6193
|
+
Project:
|
|
6194
|
+
@osovitny/anatoly
|
|
6195
|
+
|
|
6196
|
+
Authors:
|
|
6197
|
+
Vadim Osovitny vadim@osovitny.com
|
|
6198
|
+
Anatoly Osovitny anatoly@osovitny.com
|
|
6199
|
+
|
|
6200
|
+
Created:
|
|
6201
|
+
20 Sep 2023
|
|
6202
|
+
|
|
6203
|
+
Description:
|
|
6204
|
+
Identity and Access Management
|
|
6205
|
+
|
|
6206
|
+
Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
|
|
6207
|
+
</file>
|
|
6208
|
+
*/
|
|
6209
|
+
//Node
|
|
6210
|
+
class SignInPage extends BasePage {
|
|
6211
|
+
auth;
|
|
6212
|
+
constructor(auth) {
|
|
6213
|
+
super();
|
|
6214
|
+
this.auth = auth;
|
|
6215
|
+
}
|
|
6216
|
+
ngOnInit() {
|
|
6217
|
+
this.auth.login().subscribe();
|
|
6218
|
+
}
|
|
6219
|
+
static ɵfac = function SignInPage_Factory(t) { return new (t || SignInPage)(i0.ɵɵdirectiveInject(AuthService)); };
|
|
6220
|
+
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: SignInPage, selectors: [["iam-signin-page"]], features: [i0.ɵɵInheritDefinitionFeature], decls: 0, vars: 0, template: function SignInPage_Template(rf, ctx) { }, encapsulation: 2 });
|
|
6221
|
+
}
|
|
6222
|
+
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(SignInPage, [{
|
|
6223
|
+
type: Component,
|
|
6224
|
+
args: [{ selector: 'iam-signin-page', template: "" }]
|
|
6225
|
+
}], function () { return [{ type: AuthService }]; }, null); })();
|
|
6226
|
+
|
|
6227
|
+
/*
|
|
6228
|
+
<file>
|
|
6229
|
+
Project:
|
|
6230
|
+
@osovitny/anatoly
|
|
6231
|
+
|
|
6232
|
+
Authors:
|
|
6233
|
+
Vadim Osovitny vadim@osovitny.com
|
|
6234
|
+
Anatoly Osovitny anatoly@osovitny.com
|
|
6235
|
+
|
|
6236
|
+
Created:
|
|
6237
|
+
20 Sep 2023
|
|
6238
|
+
|
|
6239
|
+
Description:
|
|
6240
|
+
Identity and Access Management
|
|
6241
|
+
|
|
6242
|
+
Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
|
|
6243
|
+
</file>
|
|
6244
|
+
*/
|
|
6245
|
+
//Node
|
|
6246
|
+
class SignOutPage extends BasePage {
|
|
6247
|
+
auth;
|
|
6248
|
+
constructor(auth) {
|
|
6249
|
+
super();
|
|
6250
|
+
this.auth = auth;
|
|
6251
|
+
}
|
|
6252
|
+
ngOnInit() {
|
|
6253
|
+
this.auth.logout();
|
|
6254
|
+
}
|
|
6255
|
+
static ɵfac = function SignOutPage_Factory(t) { return new (t || SignOutPage)(i0.ɵɵdirectiveInject(AuthService)); };
|
|
6256
|
+
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: SignOutPage, selectors: [["iam-signout-page"]], features: [i0.ɵɵInheritDefinitionFeature], decls: 0, vars: 0, template: function SignOutPage_Template(rf, ctx) { }, encapsulation: 2 });
|
|
6257
|
+
}
|
|
6258
|
+
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(SignOutPage, [{
|
|
6259
|
+
type: Component,
|
|
6260
|
+
args: [{ selector: 'iam-signout-page', template: "" }]
|
|
6261
|
+
}], function () { return [{ type: AuthService }]; }, null); })();
|
|
6262
|
+
|
|
6263
|
+
/*
|
|
6264
|
+
<file>
|
|
6265
|
+
Project:
|
|
6266
|
+
@osovitny/anatoly
|
|
6267
|
+
|
|
6268
|
+
Authors:
|
|
6269
|
+
Vadim Osovitny vadim@osovitny.com
|
|
6270
|
+
Anatoly Osovitny anatoly@osovitny.com
|
|
6271
|
+
|
|
6272
|
+
Created:
|
|
6273
|
+
20 Sep 2023
|
|
6274
|
+
|
|
6275
|
+
Description:
|
|
6276
|
+
Identity and Access Management
|
|
6277
|
+
|
|
6278
|
+
Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
|
|
6279
|
+
</file>
|
|
6280
|
+
*/
|
|
6281
|
+
//Node
|
|
6282
|
+
class SignUpPage extends BasePage {
|
|
6283
|
+
auth;
|
|
6284
|
+
constructor(auth) {
|
|
6285
|
+
super();
|
|
6286
|
+
this.auth = auth;
|
|
6287
|
+
}
|
|
6288
|
+
ngOnInit() {
|
|
6289
|
+
}
|
|
6290
|
+
static ɵfac = function SignUpPage_Factory(t) { return new (t || SignUpPage)(i0.ɵɵdirectiveInject(AuthService)); };
|
|
6291
|
+
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: SignUpPage, selectors: [["iam-signup-page"]], features: [i0.ɵɵInheritDefinitionFeature], decls: 0, vars: 0, template: function SignUpPage_Template(rf, ctx) { }, encapsulation: 2 });
|
|
6292
|
+
}
|
|
6293
|
+
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(SignUpPage, [{
|
|
6294
|
+
type: Component,
|
|
6295
|
+
args: [{ selector: 'iam-signup-page', template: "" }]
|
|
6296
|
+
}], function () { return [{ type: AuthService }]; }, null); })();
|
|
6297
|
+
|
|
6298
|
+
/*
|
|
6299
|
+
<file>
|
|
6300
|
+
Project:
|
|
6301
|
+
@osovitny/anatoly
|
|
6302
|
+
|
|
6303
|
+
Authors:
|
|
6304
|
+
Vadim Osovitny vadim@osovitny.com
|
|
6305
|
+
Anatoly Osovitny anatoly@osovitny.com
|
|
6306
|
+
|
|
6307
|
+
Created:
|
|
6308
|
+
2 May 2023
|
|
6309
|
+
|
|
6310
|
+
Description:
|
|
6311
|
+
Identity and Access Management
|
|
6312
|
+
|
|
6313
|
+
Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
|
|
6314
|
+
</file>
|
|
6315
|
+
*/
|
|
6316
|
+
//Node
|
|
6317
|
+
const routes = [
|
|
6318
|
+
{
|
|
6319
|
+
path: "signin",
|
|
6320
|
+
component: SignInPage
|
|
6321
|
+
},
|
|
6322
|
+
{
|
|
6323
|
+
path: "signup",
|
|
6324
|
+
component: SignUpPage
|
|
6325
|
+
},
|
|
6326
|
+
{
|
|
6327
|
+
path: "signout",
|
|
6328
|
+
component: SignOutPage
|
|
6329
|
+
}
|
|
6330
|
+
];
|
|
6331
|
+
const IAMRouterModule = RouterModule.forChild(routes);
|
|
6332
|
+
const PAGES = [
|
|
6333
|
+
SignInPage,
|
|
6334
|
+
SignUpPage,
|
|
6335
|
+
SignOutPage
|
|
6336
|
+
];
|
|
6337
|
+
|
|
6338
|
+
/*
|
|
6339
|
+
<file>
|
|
6340
|
+
Project:
|
|
6341
|
+
@osovitny/anatoly
|
|
6342
|
+
|
|
6343
|
+
Authors:
|
|
6344
|
+
Vadim Osovitny vadim@osovitny.com
|
|
6345
|
+
Anatoly Osovitny anatoly@osovitny.com
|
|
6346
|
+
|
|
6347
|
+
Created:
|
|
6348
|
+
6 Dec 2018
|
|
6349
|
+
|
|
6350
|
+
Description:
|
|
6351
|
+
Identity and Access Management
|
|
6352
|
+
|
|
6353
|
+
Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
|
|
6354
|
+
</file>
|
|
6355
|
+
*/
|
|
6356
|
+
//Node
|
|
6357
|
+
class AnatolyIAMPagesModule {
|
|
6358
|
+
static ɵfac = function AnatolyIAMPagesModule_Factory(t) { return new (t || AnatolyIAMPagesModule)(); };
|
|
6359
|
+
static ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: AnatolyIAMPagesModule });
|
|
6360
|
+
static ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports: [CommonModule,
|
|
6361
|
+
HttpClientModule,
|
|
6362
|
+
IAMRouterModule] });
|
|
6363
|
+
}
|
|
6364
|
+
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(AnatolyIAMPagesModule, [{
|
|
6365
|
+
type: NgModule,
|
|
6366
|
+
args: [{
|
|
6367
|
+
imports: [
|
|
6368
|
+
CommonModule,
|
|
6369
|
+
HttpClientModule,
|
|
6370
|
+
IAMRouterModule
|
|
6371
|
+
],
|
|
6372
|
+
exports: [],
|
|
6373
|
+
declarations: [
|
|
6374
|
+
...PAGES
|
|
6375
|
+
],
|
|
6376
|
+
providers: []
|
|
6377
|
+
}]
|
|
6378
|
+
}], null, null); })();
|
|
6379
|
+
(function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(AnatolyIAMPagesModule, { declarations: [SignInPage, SignUpPage, SignOutPage], imports: [CommonModule,
|
|
6380
|
+
HttpClientModule, i1.RouterModule] }); })();
|
|
6381
|
+
|
|
5467
6382
|
/*
|
|
5468
6383
|
<file>
|
|
5469
6384
|
Project:
|
|
@@ -5773,8 +6688,12 @@ class AnatolyModule {
|
|
|
5773
6688
|
static ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports: [CommonModule,
|
|
5774
6689
|
AnatolyCoreModule,
|
|
5775
6690
|
AnatolyDataModule,
|
|
6691
|
+
AnatolyIAMModule,
|
|
6692
|
+
//AnatolyIAMPagesModule,
|
|
5776
6693
|
AnatolyUIModule, AnatolyCoreModule,
|
|
5777
6694
|
AnatolyDataModule,
|
|
6695
|
+
AnatolyIAMModule,
|
|
6696
|
+
//AnatolyIAMPagesModule,
|
|
5778
6697
|
AnatolyUIModule] });
|
|
5779
6698
|
}
|
|
5780
6699
|
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(AnatolyModule, [{
|
|
@@ -5784,11 +6703,15 @@ class AnatolyModule {
|
|
|
5784
6703
|
CommonModule,
|
|
5785
6704
|
AnatolyCoreModule,
|
|
5786
6705
|
AnatolyDataModule,
|
|
6706
|
+
AnatolyIAMModule,
|
|
6707
|
+
//AnatolyIAMPagesModule,
|
|
5787
6708
|
AnatolyUIModule
|
|
5788
6709
|
],
|
|
5789
6710
|
exports: [
|
|
5790
6711
|
AnatolyCoreModule,
|
|
5791
6712
|
AnatolyDataModule,
|
|
6713
|
+
AnatolyIAMModule,
|
|
6714
|
+
//AnatolyIAMPagesModule,
|
|
5792
6715
|
AnatolyUIModule
|
|
5793
6716
|
],
|
|
5794
6717
|
providers: [],
|
|
@@ -5797,8 +6720,12 @@ class AnatolyModule {
|
|
|
5797
6720
|
(function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(AnatolyModule, { imports: [CommonModule,
|
|
5798
6721
|
AnatolyCoreModule,
|
|
5799
6722
|
AnatolyDataModule,
|
|
6723
|
+
AnatolyIAMModule,
|
|
6724
|
+
//AnatolyIAMPagesModule,
|
|
5800
6725
|
AnatolyUIModule], exports: [AnatolyCoreModule,
|
|
5801
6726
|
AnatolyDataModule,
|
|
6727
|
+
AnatolyIAMModule,
|
|
6728
|
+
//AnatolyIAMPagesModule,
|
|
5802
6729
|
AnatolyUIModule] }); })();
|
|
5803
6730
|
|
|
5804
6731
|
/*
|
|
@@ -5810,5 +6737,5 @@ class AnatolyModule {
|
|
|
5810
6737
|
* Generated bundle index. Do not edit.
|
|
5811
6738
|
*/
|
|
5812
6739
|
|
|
5813
|
-
export { AddressComponent, Alerts, AnatolyCoreModule, AnatolyDataModule, AnatolyHttpInterceptor, AnatolyModule, AnatolyUIModule, ApiServiceBase, ApiUrl, AppContextService, AppCoreSettings, AppName, AppVersion, BaseComponent, BaseDialog, BaseEditComponent, BaseGoService, BaseHtmlEditorComponent, BaseList, BasePage, BasePagedPage, Browser, BuyAccessButtonComponent, CardBodyComponent, CardComponent, CardFooterComponent, CardHeaderComponent, CheckIconComponent, CompanyComponent, ContactUsDialog, ContactUsForm, Convert, Copy2ClipboardComponent, CoreApiService, DOM, DatapagerComponent, DefaultEditorOptions, DigitalMarketingService, EmailsApiService, FileSizePipe, FormValidationSummaryComponent, FormsHtmlEditorComponent, GlobalErrorHandler, GoogleAnalyticsService, GridEditServiceBase, GridReadServiceBase, Guid, HoveringDirective, HtmlEditorComponent, IdleService, InjectorInstance, ItemValidationSummaryComponent, L10NUrl, LoadingComponent, LoadingService, LocalStorageService, LocalizationInjectorInstance, LocalizationModule, LocalizationService, LocalizationSettingsModule, LocalizePipe, LoggingService, NativeElementDirective, NodataComponent, NotificationService, PageSpinnerComponent, ReplaceTextPipe, SafeHtmlPipe, SessionStorageService, SignInButtonComponent, SignOutButtonComponent, SignUpButtonComponent, StarterServiceBase, Stopwatch, Subs, SubscribePlanButtonComponent, TimezoneDropdownlist, UrlSlugComponent, Utils, ValidationSummaryComponent, XmlFormatter, localizationInitializerFactory, throwIfAlreadyLoaded, translateLoaderFactory };
|
|
6740
|
+
export { AddressComponent, Alerts, AnatolyCoreModule, AnatolyDataModule, AnatolyHttpInterceptor, AnatolyIAMModule, AnatolyIAMPagesModule, AnatolyModule, AnatolyUIModule, ApiServiceBase, ApiUrl, AppContextService, AppCoreSettings, AppName, AppVersion, AuthService, BaseComponent, BaseDialog, BaseEditComponent, BaseGoService, BaseHtmlEditorComponent, BaseList, BasePage, BasePagedPage, Browser, BuyAccessButtonComponent, CardBodyComponent, CardComponent, CardFooterComponent, CardHeaderComponent, CheckIconComponent, CompanyComponent, ContactUsDialog, ContactUsForm, Convert, Copy2ClipboardComponent, CoreApiService, DOM, DatapagerComponent, DefaultEditorOptions, DigitalMarketingService, EmailsApiService, FileSizePipe, FormValidationSummaryComponent, FormsHtmlEditorComponent, GlobalErrorHandler, GoogleAnalyticsService, GridEditServiceBase, GridReadServiceBase, Guid, HoveringDirective, HtmlEditorComponent, IdleService, InjectorInstance, ItemValidationSummaryComponent, L10NUrl, LoadingComponent, LoadingService, LocalStorageService, LocalizationInjectorInstance, LocalizationModule, LocalizationService, LocalizationSettingsModule, LocalizePipe, LoggingService, NativeElementDirective, NodataComponent, NotificationService, PageSpinnerComponent, ReplaceTextPipe, SafeHtmlPipe, SessionStorageService, SignInButtonComponent, SignOutButtonComponent, SignUpButtonComponent, StarterServiceBase, Stopwatch, Subs, SubscribePlanButtonComponent, TimezoneDropdownlist, UrlSlugComponent, Utils, ValidationSummaryComponent, XmlFormatter, localizationInitializerFactory, throwIfAlreadyLoaded, translateLoaderFactory };
|
|
5814
6741
|
//# sourceMappingURL=osovitny-anatoly.mjs.map
|