@brggroup/share-lib 0.1.12 → 0.1.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.
@@ -722,13 +722,16 @@ class AuthService extends HTTPService {
722
722
  static pingInterVal;
723
723
  startPingAuth(intervalTime) {
724
724
  if (!AuthService.pingInterVal) {
725
- AuthService.pingInterVal = setInterval(() => this.pingAuth(), intervalTime || 60 * 1000);
725
+ if (!intervalTime || intervalTime < 5 * 60 * 1000) {
726
+ intervalTime = 5 * 60 * 1000;
727
+ }
728
+ AuthService.pingInterVal = setInterval(() => {
729
+ if (TokenStorage.getToken()) {
730
+ this.pingAuth();
731
+ }
732
+ }, intervalTime);
726
733
  }
727
734
  }
728
- stopPingAuth() {
729
- clearInterval(AuthService.pingInterVal);
730
- AuthService.pingInterVal = undefined;
731
- }
732
735
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.7", ngImport: i0, type: AuthService, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
733
736
  static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.7", ngImport: i0, type: AuthService, providedIn: 'root' });
734
737
  }
@@ -747,7 +750,6 @@ class AuthGuard {
747
750
  if (await this.authService.pingAuth()) {
748
751
  return true;
749
752
  }
750
- this.authService.startPingAuth();
751
753
  TokenStorage.clearToken();
752
754
  if (state.url != '/') {
753
755
  if (!state.url.startsWith('/login')) {
@@ -7103,7 +7105,6 @@ class LoginComponent extends BaseComponent {
7103
7105
  isOneUserMultiOrgs = false;
7104
7106
  SYSTEM_NAME_LOGIN = '';
7105
7107
  async ngOnInit() {
7106
- this.authService.stopPingAuth();
7107
7108
  this.route.queryParams.subscribe((params) => (this.returnUrl = params['returnUrl'] || '/'));
7108
7109
  if (TokenStorage.getToken() && (await this.authService.pingAuth())) {
7109
7110
  this.goto(this.returnUrl);