@trudb/tru-common-lib 0.0.674 → 0.0.675

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.
@@ -5857,16 +5857,16 @@ class TruAuthJwtStrategy {
5857
5857
  }
5858
5858
  getCurrentUser() {
5859
5859
  //todo check v6 for how this should be done
5860
- return of(JSON.parse(localStorage.getItem(this.JWT_TOKEN)).user);
5860
+ return of(JSON.parse(localStorage.getItem(this.JWT_TOKEN))?.user);
5861
5861
  }
5862
5862
  isLoggedIn() {
5863
5863
  return !!this.getJwtToken();
5864
5864
  }
5865
5865
  getJwtToken() {
5866
- return JSON.parse(localStorage.getItem(this.JWT_TOKEN)).jwt;
5866
+ return JSON.parse(localStorage.getItem(this.JWT_TOKEN))?.jwt;
5867
5867
  }
5868
5868
  getToken() {
5869
- var token = JSON.parse(localStorage.getItem(this.JWT_TOKEN)).jwt;
5869
+ var token = JSON.parse(localStorage.getItem(this.JWT_TOKEN))?.jwt;
5870
5870
  if (token && token !== "undefined") {
5871
5871
  const encodedPayload = token.split(".")[1];
5872
5872
  const payloadStr = window.atob(encodedPayload);