@brggroup/share-lib 0.1.11 → 0.1.12
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/fesm2022/brggroup-share-lib.mjs +12 -0
- package/fesm2022/brggroup-share-lib.mjs.map +1 -1
- package/lib/auth/auth.guard.d.ts.map +1 -1
- package/lib/auth/auth.service.d.ts +3 -0
- package/lib/auth/auth.service.d.ts.map +1 -1
- package/lib/components/login/login.component.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -719,6 +719,16 @@ class AuthService extends HTTPService {
|
|
|
719
719
|
let params = new HttpParams().append('App_Org_Id', App_Org_Id);
|
|
720
720
|
return this.postParams(AppGlobals.apiEndpoint + URLs$4.changeOrgLogin, params);
|
|
721
721
|
}
|
|
722
|
+
static pingInterVal;
|
|
723
|
+
startPingAuth(intervalTime) {
|
|
724
|
+
if (!AuthService.pingInterVal) {
|
|
725
|
+
AuthService.pingInterVal = setInterval(() => this.pingAuth(), intervalTime || 60 * 1000);
|
|
726
|
+
}
|
|
727
|
+
}
|
|
728
|
+
stopPingAuth() {
|
|
729
|
+
clearInterval(AuthService.pingInterVal);
|
|
730
|
+
AuthService.pingInterVal = undefined;
|
|
731
|
+
}
|
|
722
732
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.7", ngImport: i0, type: AuthService, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
|
|
723
733
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.7", ngImport: i0, type: AuthService, providedIn: 'root' });
|
|
724
734
|
}
|
|
@@ -737,6 +747,7 @@ class AuthGuard {
|
|
|
737
747
|
if (await this.authService.pingAuth()) {
|
|
738
748
|
return true;
|
|
739
749
|
}
|
|
750
|
+
this.authService.startPingAuth();
|
|
740
751
|
TokenStorage.clearToken();
|
|
741
752
|
if (state.url != '/') {
|
|
742
753
|
if (!state.url.startsWith('/login')) {
|
|
@@ -7092,6 +7103,7 @@ class LoginComponent extends BaseComponent {
|
|
|
7092
7103
|
isOneUserMultiOrgs = false;
|
|
7093
7104
|
SYSTEM_NAME_LOGIN = '';
|
|
7094
7105
|
async ngOnInit() {
|
|
7106
|
+
this.authService.stopPingAuth();
|
|
7095
7107
|
this.route.queryParams.subscribe((params) => (this.returnUrl = params['returnUrl'] || '/'));
|
|
7096
7108
|
if (TokenStorage.getToken() && (await this.authService.pingAuth())) {
|
|
7097
7109
|
this.goto(this.returnUrl);
|