@resolveio/client-lib-core 15.0.11 → 15.1.0

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.
@@ -1176,12 +1176,35 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
1176
1176
  type: Injectable
1177
1177
  }], ctorParameters: function () { return [{ type: i1$2.LocalStorageService }]; } });
1178
1178
 
1179
+ class TokenManagerService {
1180
+ constructor(_storage) {
1181
+ this._storage = _storage;
1182
+ }
1183
+ getToken(tokenKey) {
1184
+ return this._storage.get(tokenKey);
1185
+ }
1186
+ setToken(tokenKey, tokenValue) {
1187
+ this._storage.set(tokenKey, tokenValue);
1188
+ }
1189
+ removeToken(tokenKey) {
1190
+ if (this.getToken(tokenKey) !== null) {
1191
+ this._storage.remove(tokenKey);
1192
+ }
1193
+ }
1194
+ }
1195
+ TokenManagerService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: TokenManagerService, deps: [{ token: i1$2.LocalStorageService }], target: i0.ɵɵFactoryTarget.Injectable });
1196
+ TokenManagerService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: TokenManagerService });
1197
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: TokenManagerService, decorators: [{
1198
+ type: Injectable
1199
+ }], ctorParameters: function () { return [{ type: i1$2.LocalStorageService }]; } });
1200
+
1179
1201
  class SocketManagerService {
1180
- constructor(_socket, _offline, _alert, _router) {
1202
+ constructor(_socket, _offline, _alert, _router, _token) {
1181
1203
  this._socket = _socket;
1182
1204
  this._offline = _offline;
1183
1205
  this._alert = _alert;
1184
1206
  this._router = _router;
1207
+ this._token = _token;
1185
1208
  this.messageId = 0;
1186
1209
  this._cbArray = [];
1187
1210
  this._subArray = [];
@@ -1313,6 +1336,7 @@ class SocketManagerService {
1313
1336
  this._socket.openSocket(environment, protocols);
1314
1337
  }
1315
1338
  closeSocket() {
1339
+ this._token.removeToken('accessToken');
1316
1340
  this._socket.close();
1317
1341
  }
1318
1342
  call(method, ...parameters) {
@@ -1492,31 +1516,11 @@ class SocketManagerService {
1492
1516
  return this._socket.readyState$;
1493
1517
  }
1494
1518
  }
1495
- SocketManagerService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: SocketManagerService, deps: [{ token: SocketService }, { token: OfflineManagerService }, { token: AlertService }, { token: i1$3.Router }], target: i0.ɵɵFactoryTarget.Injectable });
1519
+ SocketManagerService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: SocketManagerService, deps: [{ token: SocketService }, { token: OfflineManagerService }, { token: AlertService }, { token: i1$3.Router }, { token: TokenManagerService }], target: i0.ɵɵFactoryTarget.Injectable });
1496
1520
  SocketManagerService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: SocketManagerService });
1497
1521
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: SocketManagerService, decorators: [{
1498
1522
  type: Injectable
1499
- }], ctorParameters: function () { return [{ type: SocketService }, { type: OfflineManagerService }, { type: AlertService }, { type: i1$3.Router }]; } });
1500
-
1501
- class TokenManagerService {
1502
- constructor(_storage) {
1503
- this._storage = _storage;
1504
- }
1505
- getToken(tokenKey) {
1506
- return this._storage.get(tokenKey);
1507
- }
1508
- setToken(tokenKey, tokenValue) {
1509
- this._storage.set(tokenKey, tokenValue);
1510
- }
1511
- removeToken(tokenKey) {
1512
- this._storage.remove(tokenKey);
1513
- }
1514
- }
1515
- TokenManagerService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: TokenManagerService, deps: [{ token: i1$2.LocalStorageService }], target: i0.ɵɵFactoryTarget.Injectable });
1516
- TokenManagerService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: TokenManagerService });
1517
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: TokenManagerService, decorators: [{
1518
- type: Injectable
1519
- }], ctorParameters: function () { return [{ type: i1$2.LocalStorageService }]; } });
1523
+ }], ctorParameters: function () { return [{ type: SocketService }, { type: OfflineManagerService }, { type: AlertService }, { type: i1$3.Router }, { type: TokenManagerService }]; } });
1520
1524
 
1521
1525
  class AccountManagerService {
1522
1526
  constructor(_router, _socket, _token, _http, _alert, _offline) {
@@ -1538,6 +1542,7 @@ class AccountManagerService {
1538
1542
  if (token) {
1539
1543
  this.initLogin(token);
1540
1544
  setInterval(() => {
1545
+ token = this._token.getToken('refreshToken');
1541
1546
  this.initLogin(token);
1542
1547
  }, 3000);
1543
1548
  }
@@ -1641,7 +1646,6 @@ class AccountManagerService {
1641
1646
  setTimeout(() => {
1642
1647
  this.user.next(null);
1643
1648
  this._token.removeToken('refreshToken');
1644
- this._token.removeToken('accessToken');
1645
1649
  this._offline.removeUser();
1646
1650
  this.closeSocket();
1647
1651
  resolve(true);