@sunbird-cb/utils 1.0.16 → 1.0.17

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.
@@ -8,8 +8,8 @@ import { map, debounceTime, distinctUntilChanged, throttleTime, filter, catchErr
8
8
  import { CommonModule } from '@angular/common';
9
9
  import { MatIconModule, MatButtonModule, MatDialogModule, MatToolbarModule, MatCardModule, MatTooltipModule, MatSliderModule, MatProgressSpinnerModule, MatDialogRef as MatDialogRef$1 } from '@angular/material';
10
10
  import { ImageCropperModule } from 'ngx-image-cropper';
11
- import { HttpClient } from '@angular/common/http';
12
11
  import { KeycloakEventType, KeycloakService } from 'keycloak-angular';
12
+ import { HttpClient } from '@angular/common/http';
13
13
  import { Platform } from '@angular/cdk/platform';
14
14
  import { NavigationEnd, Router, ActivatedRoute } from '@angular/router';
15
15
  import * as _moment from 'moment';
@@ -1807,9 +1807,8 @@ if (false) {
1807
1807
  var storage$1 = localStorage;
1808
1808
  var storageKey$1 = 'kc';
1809
1809
  var AuthKeycloakService = (function () {
1810
- function AuthKeycloakService(http, configSvc, keycloakSvc, msAuthSvc) {
1810
+ function AuthKeycloakService(configSvc, keycloakSvc, msAuthSvc) {
1811
1811
  var _this = this;
1812
- this.http = http;
1813
1812
  this.configSvc = configSvc;
1814
1813
  this.keycloakSvc = keycloakSvc;
1815
1814
  this.msAuthSvc = msAuthSvc;
@@ -1952,7 +1951,7 @@ var AuthKeycloakService = (function () {
1952
1951
  if (_redirectUrl === void 0) { _redirectUrl = this.defaultRedirectUrl; }
1953
1952
  return __awaiter(this, void 0, void 0, function () {
1954
1953
  return __generator(this, function (_a) {
1955
- window.location.href = _redirectUrl + "apis/reset";
1954
+ window.location.href = _redirectUrl + "public/logout";
1956
1955
  return [2];
1957
1956
  });
1958
1957
  });
@@ -1960,24 +1959,23 @@ var AuthKeycloakService = (function () {
1960
1959
  AuthKeycloakService.prototype.force_logout = function () {
1961
1960
  return __awaiter(this, void 0, void 0, function () {
1962
1961
  return __generator(this, function (_a) {
1963
- switch (_a.label) {
1964
- case 0:
1965
- if (storage$1.getItem('telemetrySessionId')) {
1966
- storage$1.removeItem('telemetrySessionId');
1967
- }
1968
- try {
1969
- sessionStorage.clear();
1970
- localStorage.clear();
1971
- }
1972
- catch (_b) {
1973
- }
1974
- storage$1.removeItem(storageKey$1);
1975
- window.location.href = '/public/logout';
1976
- return [4, this.http.get('/apis/reset').toPromise()];
1977
- case 1:
1978
- _a.sent();
1979
- return [2];
1962
+ if (storage$1.getItem('telemetrySessionId')) {
1963
+ storage$1.removeItem('telemetrySessionId');
1964
+ }
1965
+ storage$1.removeItem(storageKey$1);
1966
+ if (localStorage.getItem('login') === 'true') {
1967
+ try {
1968
+ sessionStorage.clear();
1969
+ localStorage.clear();
1970
+ }
1971
+ catch (_b) {
1972
+ }
1973
+ window.location.href = this.defaultRedirectUrl + "apis/reset";
1980
1974
  }
1975
+ else {
1976
+ window.location.href = this.defaultRedirectUrl + "public/logout";
1977
+ }
1978
+ return [2];
1981
1979
  });
1982
1980
  });
1983
1981
  };
@@ -2089,17 +2087,15 @@ var AuthKeycloakService = (function () {
2089
2087
  },] }
2090
2088
  ];
2091
2089
  AuthKeycloakService.ctorParameters = function () { return [
2092
- { type: HttpClient },
2093
2090
  { type: ConfigurationsService },
2094
2091
  { type: KeycloakService },
2095
2092
  { type: AuthMicrosoftService }
2096
2093
  ]; };
2097
- /** @nocollapse */ AuthKeycloakService.ngInjectableDef = ɵɵdefineInjectable({ factory: function AuthKeycloakService_Factory() { return new AuthKeycloakService(ɵɵinject(HttpClient), ɵɵinject(ConfigurationsService), ɵɵinject(KeycloakService), ɵɵinject(AuthMicrosoftService)); }, token: AuthKeycloakService, providedIn: "root" });
2094
+ /** @nocollapse */ AuthKeycloakService.ngInjectableDef = ɵɵdefineInjectable({ factory: function AuthKeycloakService_Factory() { return new AuthKeycloakService(ɵɵinject(ConfigurationsService), ɵɵinject(KeycloakService), ɵɵinject(AuthMicrosoftService)); }, token: AuthKeycloakService, providedIn: "root" });
2098
2095
  return AuthKeycloakService;
2099
2096
  }());
2100
2097
  if (false) {
2101
2098
  AuthKeycloakService.prototype.loginChangeSubject;
2102
- AuthKeycloakService.prototype.http;
2103
2099
  AuthKeycloakService.prototype.configSvc;
2104
2100
  AuthKeycloakService.prototype.keycloakSvc;
2105
2101
  AuthKeycloakService.prototype.msAuthSvc;