@arsedizioni/ars-utils 20.3.15 → 20.3.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.
@@ -2233,7 +2233,6 @@ class ClipperService {
2233
2233
  .subscribe({
2234
2234
  next: r => {
2235
2235
  if (!r.success) {
2236
- localStorage.removeItem('clipper_context');
2237
2236
  this.dialogService.error(r.message, undefined, "Errore in Clipper");
2238
2237
  }
2239
2238
  else {
@@ -2269,7 +2268,6 @@ class ClipperService {
2269
2268
  },
2270
2269
  complete: () => {
2271
2270
  this.clear();
2272
- localStorage.removeItem('clipper_context');
2273
2271
  if (onSuccess) {
2274
2272
  onSuccess();
2275
2273
  }
@@ -2306,14 +2304,14 @@ class ClipperService {
2306
2304
  })
2307
2305
  .pipe(catchError(err => {
2308
2306
  this.loggingIn.set(false);
2309
- localStorage.removeItem('clipper_context');
2310
2307
  return throwError(() => err);
2311
2308
  }), map((r) => {
2312
2309
  if (r.success) {
2313
- if (!this._loginInfo)
2310
+ if (!this._loginInfo) {
2314
2311
  this._loginInfo = { context: undefined };
2312
+ }
2315
2313
  this._loginInfo.oauth = oauth;
2316
- this._loginInfo.remember = remember;
2314
+ this._loginInfo.remember = (flags & ClipperLoginFlags.RememberCredentials) > 0;
2317
2315
  if (!oauth && r.value.requiresMfa) {
2318
2316
  // Notify login is pending
2319
2317
  this.broadcastService.sendMessage(ClipperMessages.LOGIN_PENDING, { flags: flags });
@@ -2351,7 +2349,6 @@ class ClipperService {
2351
2349
  return this.httpClient
2352
2350
  .post(this._serviceUri + '/login/confirm/' + code + '/?flags=' + flags, {})
2353
2351
  .pipe(catchError((err) => {
2354
- localStorage.removeItem('clipper_context');
2355
2352
  this.loggingIn.set(false);
2356
2353
  return throwError(() => err);
2357
2354
  }), map((r) => {
@@ -2394,7 +2391,6 @@ class ClipperService {
2394
2391
  */
2395
2392
  clear(clearOAuthToken = false) {
2396
2393
  // Clear local storage
2397
- localStorage.removeItem('clipper_context');
2398
2394
  sessionStorage.removeItem('clipper_auth');
2399
2395
  sessionStorage.removeItem('clipper_oauth');
2400
2396
  if (clearOAuthToken) {