@bnsights/bbsf-admin-portal 1.2.11 → 1.2.13
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/README.md
CHANGED
|
@@ -4,6 +4,23 @@ BBSF Admin Portal package is part of BBSF 3 packages. It hosts all the angular m
|
|
|
4
4
|
|
|
5
5
|
For more info please visit [BBSF documentation](https://bnsightsprojects.visualstudio.com/BBSF%203/_wiki/wikis/BBSF-3.wiki/65/BBSF-Documentation)
|
|
6
6
|
|
|
7
|
+
|
|
8
|
+
## 1.2.13 / 24-03-2026
|
|
9
|
+
|
|
10
|
+
=====================
|
|
11
|
+
|
|
12
|
+
- Update controls package to 1.2.13
|
|
13
|
+
|
|
14
|
+
## 1.2.12 / 04-02-2026
|
|
15
|
+
|
|
16
|
+
=====================
|
|
17
|
+
|
|
18
|
+
- Update controls package to 1.2.12
|
|
19
|
+
- Update Utilities package to 1.2.6
|
|
20
|
+
- Improved authentication guard to wait for token refresh completion
|
|
21
|
+
- Fixed login page initialization when user is already authenticated
|
|
22
|
+
- Enhanced error handling for unauthorized requests
|
|
23
|
+
|
|
7
24
|
## 1.2.11 / 20-01-2026
|
|
8
25
|
|
|
9
26
|
=====================
|
|
@@ -11,7 +28,6 @@ For more info please visit [BBSF documentation](https://bnsightsprojects.visuals
|
|
|
11
28
|
- Update controls package to 1.2.11
|
|
12
29
|
- Update Utilities package to 1.2.5
|
|
13
30
|
|
|
14
|
-
|
|
15
31
|
## 1.2.10 / 05-01-2026
|
|
16
32
|
|
|
17
33
|
=====================
|
|
@@ -11,7 +11,7 @@ import { RequestOptionsModel, AuthService, EnvironmentService, UtilityService, B
|
|
|
11
11
|
import { __decorate } from 'tslib';
|
|
12
12
|
import * as i1$2 from 'ng-block-ui';
|
|
13
13
|
import { BlockUI, BlockUIModule } from 'ng-block-ui';
|
|
14
|
-
import { BehaviorSubject, throwError, of } from 'rxjs';
|
|
14
|
+
import { BehaviorSubject, Observable, throwError, of } from 'rxjs';
|
|
15
15
|
import * as objectPath from 'object-path';
|
|
16
16
|
import { createPopper } from '@popperjs/core';
|
|
17
17
|
import * as i11 from 'ng-inline-svg-2';
|
|
@@ -3409,7 +3409,35 @@ class AuthGuard {
|
|
|
3409
3409
|
this.homeURL = "";
|
|
3410
3410
|
}
|
|
3411
3411
|
canActivate(route, state) {
|
|
3412
|
-
if
|
|
3412
|
+
// Check if refresh is in progress
|
|
3413
|
+
const refreshLockKey = 'auth_refreshing_lock';
|
|
3414
|
+
const lockValue = localStorage.getItem(refreshLockKey);
|
|
3415
|
+
const isRefreshing = !!lockValue && Date.now() - parseInt(lockValue) < 5000;
|
|
3416
|
+
if (isRefreshing) {
|
|
3417
|
+
// Wait for refresh to complete by polling the lock
|
|
3418
|
+
return new Observable(observer => {
|
|
3419
|
+
const checkInterval = setInterval(() => {
|
|
3420
|
+
const currentLock = localStorage.getItem(refreshLockKey);
|
|
3421
|
+
const stillRefreshing = currentLock && Date.now() - parseInt(currentLock) < 5000;
|
|
3422
|
+
if (!stillRefreshing) {
|
|
3423
|
+
clearInterval(checkInterval);
|
|
3424
|
+
observer.next(this.evaluateAuth(route, state));
|
|
3425
|
+
observer.complete();
|
|
3426
|
+
}
|
|
3427
|
+
}, 100); // Check every 100ms
|
|
3428
|
+
// Timeout after 10 seconds
|
|
3429
|
+
setTimeout(() => {
|
|
3430
|
+
clearInterval(checkInterval);
|
|
3431
|
+
observer.next(this.evaluateAuth(route, state));
|
|
3432
|
+
observer.complete();
|
|
3433
|
+
}, 10000);
|
|
3434
|
+
});
|
|
3435
|
+
}
|
|
3436
|
+
return this.evaluateAuth(route, state);
|
|
3437
|
+
}
|
|
3438
|
+
evaluateAuth(route, state) {
|
|
3439
|
+
const isAuth = this.authService.isAuthenticated();
|
|
3440
|
+
if (isAuth) {
|
|
3413
3441
|
let currentSelectedPermissionSetID = Number.parseInt(AuthService.user.profile["selectedpermissionsetid"]);
|
|
3414
3442
|
let excludedUrls = ['Admin/Home'];
|
|
3415
3443
|
let isExcludedUrl = excludedUrls.some(url => state.url.toLocaleLowerCase().includes(url.toLocaleLowerCase()));
|
|
@@ -23057,6 +23085,12 @@ class LoginComponent {
|
|
|
23057
23085
|
};
|
|
23058
23086
|
}
|
|
23059
23087
|
ngOnInit() {
|
|
23088
|
+
// Check if user is already authenticated BEFORE doing anything
|
|
23089
|
+
// This prevents login form initialization from conflicting with post-refresh navigation
|
|
23090
|
+
if (this.authService.isAuthenticated()) {
|
|
23091
|
+
this.router.navigate([this.authService.getUrl()]);
|
|
23092
|
+
return; // Don't initialize login form
|
|
23093
|
+
}
|
|
23060
23094
|
let body = document.getElementsByTagName("body")[0];
|
|
23061
23095
|
if (body) {
|
|
23062
23096
|
body.removeAttribute("class");
|
|
@@ -23731,12 +23765,10 @@ class HttpErrorInterceptor {
|
|
|
23731
23765
|
// server-side error
|
|
23732
23766
|
errorMessage = `Error Code: ${error.status}\nMessage: ${error.message}`;
|
|
23733
23767
|
if (error.status == 401) {
|
|
23734
|
-
//
|
|
23735
|
-
|
|
23736
|
-
|
|
23737
|
-
// //console.log(error.message);
|
|
23768
|
+
// Clear auth state before redirect
|
|
23769
|
+
const authService = this.injector.get(AuthService);
|
|
23770
|
+
authService.clearLocalAuthState({ keepRedirectUrl: true });
|
|
23738
23771
|
this.zone.run(() => router.navigate(["/Admin/account/login"]));
|
|
23739
|
-
//return notificationService.error(`${error.statusText}`, false, null, 5000);
|
|
23740
23772
|
}
|
|
23741
23773
|
else if (error.status == 516) {
|
|
23742
23774
|
this.zone.run(() => router.navigate([`/Admin/account/error/${error.status}/${error.error}`]));
|