@arsedizioni/ars-utils 19.0.148 → 19.0.150

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.
@@ -115,7 +115,7 @@ export declare class ClipperService implements OnDestroy {
115
115
  /**
116
116
  * Perform token refresh
117
117
  */
118
- refresh(): import("rxjs").Observable<void>;
118
+ refresh(): import("rxjs").Observable<ApiResult<ClipperLoginResult>>;
119
119
  /**
120
120
  * Initialize channels
121
121
  */
@@ -107,7 +107,7 @@ export declare class EvolutionService implements OnDestroy {
107
107
  /**
108
108
  * Perform token refresh
109
109
  */
110
- refresh(): import("rxjs").Observable<void>;
110
+ refresh(): import("rxjs").Observable<ApiResult<EvolutionLoginResult>>;
111
111
  /**
112
112
  * Convert folders in a tree of Node object.
113
113
  * @param folders : the subfolders group or null to root
@@ -2209,14 +2209,19 @@ class ClipperService {
2209
2209
  }
2210
2210
  // Eveluate current session storage in case of page refresh (F5)
2211
2211
  if (!this.loggedIn() && !this.isTokenExpired()) {
2212
- // Auto login
2213
- this.loggedIn.set(true);
2214
- // Notify
2215
- this.broadcastService.sendMessage(ClipperMessages.LOGIN_COMPLETED);
2216
- // Keep alive
2217
- this.setKeepAlive();
2218
- // Initialize channels
2219
- this.initializeChannels();
2212
+ // Refresh token
2213
+ this.refresh().subscribe(r => {
2214
+ if (r.success) {
2215
+ // Auto login
2216
+ this.loggedIn.set(true);
2217
+ // Keep alive
2218
+ this.setKeepAlive();
2219
+ // Initialize channels
2220
+ this.initializeChannels();
2221
+ // Notify
2222
+ this.broadcastService.sendMessage(ClipperMessages.LOGIN_COMPLETED);
2223
+ }
2224
+ });
2220
2225
  }
2221
2226
  }
2222
2227
  /**
@@ -2452,6 +2457,7 @@ class ClipperService {
2452
2457
  return this.httpClient.get(this._serviceUri + '/refresh2/?token=' + this.getToken(true)).pipe(map((r) => {
2453
2458
  // Update token
2454
2459
  this.setToken(r.value);
2460
+ return r;
2455
2461
  }));
2456
2462
  }
2457
2463
  /**