@trudb/tru-common-lib 0.0.672 → 0.0.674
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.
- package/esm2020/lib/components/login/classes/tru-auth-jwt-strategy.mjs +4 -4
- package/fesm2015/trudb-tru-common-lib.mjs +3 -3
- package/fesm2015/trudb-tru-common-lib.mjs.map +1 -1
- package/fesm2020/trudb-tru-common-lib.mjs +3 -3
- package/fesm2020/trudb-tru-common-lib.mjs.map +1 -1
- package/lib/components/login/classes/tru-auth-jwt-strategy.d.ts +2 -2
- package/package.json +1 -1
|
@@ -5850,7 +5850,7 @@ class TruAuthJwtStrategy {
|
|
|
5850
5850
|
this.JWT_TOKEN = "JWT_TOKEN";
|
|
5851
5851
|
}
|
|
5852
5852
|
doLoginUser(token) {
|
|
5853
|
-
localStorage.setItem(this.JWT_TOKEN, token
|
|
5853
|
+
localStorage.setItem(this.JWT_TOKEN, JSON.stringify(token));
|
|
5854
5854
|
}
|
|
5855
5855
|
doLogoutUser() {
|
|
5856
5856
|
localStorage.removeItem(this.JWT_TOKEN);
|
|
@@ -5863,10 +5863,10 @@ class TruAuthJwtStrategy {
|
|
|
5863
5863
|
return !!this.getJwtToken();
|
|
5864
5864
|
}
|
|
5865
5865
|
getJwtToken() {
|
|
5866
|
-
return localStorage.getItem(this.JWT_TOKEN);
|
|
5866
|
+
return JSON.parse(localStorage.getItem(this.JWT_TOKEN)).jwt;
|
|
5867
5867
|
}
|
|
5868
5868
|
getToken() {
|
|
5869
|
-
var token = localStorage.getItem(this.JWT_TOKEN);
|
|
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);
|