@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.
- package/esm2020/lib/components/login/classes/tru-auth-jwt-strategy.mjs +4 -4
- package/fesm2015/trudb-tru-common-lib.mjs +6 -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/package.json +1 -1
|
@@ -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))
|
|
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))
|
|
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))
|
|
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);
|