@snugdesk/core 0.2.20 → 0.2.21

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.
@@ -590,11 +590,13 @@ class SnugdeskAuthenticationService {
590
590
  this.isAuthenticated$.next(this.isAuthenticated());
591
591
  }
592
592
  getToken() {
593
- return sessionStorage.getItem(this.TOKEN_KEY);
593
+ // return sessionStorage.getItem(this.TOKEN_KEY);
594
+ return localStorage.getItem(this.TOKEN_KEY);
594
595
  }
595
596
  setToken(token) {
596
597
  const isValid = this.checkToken(token);
597
- token ? sessionStorage.setItem(this.TOKEN_KEY, token) : sessionStorage.removeItem(this.TOKEN_KEY);
598
+ // token ? sessionStorage.setItem(this.TOKEN_KEY, token) : sessionStorage.removeItem(this.TOKEN_KEY);
599
+ token ? localStorage.setItem(this.TOKEN_KEY, token) : localStorage.removeItem(this.TOKEN_KEY);
598
600
  this.isAuthenticated$.next(isValid);
599
601
  }
600
602
  checkToken(token) {
@@ -748,7 +750,8 @@ class SnugdeskAuthenticationService {
748
750
  console.error(error);
749
751
  }
750
752
  finally {
751
- sessionStorage.removeItem(this.TOKEN_KEY);
753
+ // sessionStorage.removeItem(this.TOKEN_KEY);
754
+ localStorage.removeItem(this.TOKEN_KEY);
752
755
  this.userSessionSubscription?.unsubscribe();
753
756
  this.isAuthenticated$?.next(false);
754
757
  this.userSession$?.next(null);