@brggroup/share-lib 0.0.29 → 0.0.30
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.
|
@@ -409,6 +409,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.7", ngImpor
|
|
|
409
409
|
|
|
410
410
|
class TokenStorage {
|
|
411
411
|
static JWT_TOKEN = 'JWT_TOKEN';
|
|
412
|
+
static JWT_RFT_TOKEN = 'JWT_RFT_TOKEN';
|
|
412
413
|
static USER_NAME = 'username';
|
|
413
414
|
static FULL_NAME = 'fullname';
|
|
414
415
|
static USER_MENU = 'usermenu';
|
|
@@ -417,6 +418,7 @@ class TokenStorage {
|
|
|
417
418
|
static ORG_NAME = 'orgname';
|
|
418
419
|
static saveToken(tokenRes) {
|
|
419
420
|
AppStorage.tokenStorage.setItem(this.JWT_TOKEN, tokenRes.Data.Token);
|
|
421
|
+
AppStorage.tokenStorage.setItem(this.JWT_RFT_TOKEN, tokenRes.Data.RefreshToken);
|
|
420
422
|
const userInfo = jwtDecode(tokenRes.Data.Token);
|
|
421
423
|
AppStorage.tokenStorage.setItem(this.USER_NAME, userInfo[this.USER_NAME]);
|
|
422
424
|
AppStorage.tokenStorage.setItem(this.FULL_NAME, userInfo[this.FULL_NAME]);
|
|
@@ -448,6 +450,9 @@ class TokenStorage {
|
|
|
448
450
|
static getToken() {
|
|
449
451
|
return AppStorage.tokenStorage.getItem(this.JWT_TOKEN);
|
|
450
452
|
}
|
|
453
|
+
static getRftToken() {
|
|
454
|
+
return AppStorage.tokenStorage.getItem(this.JWT_RFT_TOKEN);
|
|
455
|
+
}
|
|
451
456
|
static isLoggedIn() {
|
|
452
457
|
return AppStorage.tokenStorage.getItem(this.JWT_TOKEN) != null;
|
|
453
458
|
}
|