@ts-core/angular 15.0.29 → 15.0.31
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/cookie/CookieService.d.ts +1 -0
- package/esm2020/cookie/CookieService.mjs +9 -1
- package/esm2020/login/LoginTokenStorage.mjs +10 -21
- package/fesm2015/ts-core-angular.mjs +17 -19
- package/fesm2015/ts-core-angular.mjs.map +1 -1
- package/fesm2020/ts-core-angular.mjs +17 -19
- package/fesm2020/ts-core-angular.mjs.map +1 -1
- package/login/LoginTokenStorage.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1094,6 +1094,14 @@ class CookieService extends Cookie.CookieService {
|
|
|
1094
1094
|
getObject(key, defaultValue) {
|
|
1095
1095
|
return this.has(key) ? super.getObject(key) : defaultValue;
|
|
1096
1096
|
}
|
|
1097
|
+
put(key, value, options) {
|
|
1098
|
+
if (!_.isNil(value)) {
|
|
1099
|
+
super.put(key, value, options);
|
|
1100
|
+
}
|
|
1101
|
+
else {
|
|
1102
|
+
super.remove(key);
|
|
1103
|
+
}
|
|
1104
|
+
}
|
|
1097
1105
|
putObject(key, value, options) {
|
|
1098
1106
|
super.putObject(key, value, options);
|
|
1099
1107
|
}
|
|
@@ -3300,7 +3308,6 @@ class LoginTokenStorage extends DestroyableContainer {
|
|
|
3300
3308
|
super();
|
|
3301
3309
|
this.storage = storage;
|
|
3302
3310
|
this.cookies = cookies;
|
|
3303
|
-
console.log(storage.get);
|
|
3304
3311
|
}
|
|
3305
3312
|
//--------------------------------------------------------------------------
|
|
3306
3313
|
//
|
|
@@ -3308,28 +3315,19 @@ class LoginTokenStorage extends DestroyableContainer {
|
|
|
3308
3315
|
//
|
|
3309
3316
|
//--------------------------------------------------------------------------
|
|
3310
3317
|
get() {
|
|
3311
|
-
|
|
3312
|
-
try {
|
|
3313
|
-
value = this.storage.get(LoginTokenStorage.TOKEN_KEY);
|
|
3314
|
-
}
|
|
3315
|
-
catch (error) { }
|
|
3316
|
-
return !_.isNil(value) ? value : this.cookies.get(LoginTokenStorage.TOKEN_KEY);
|
|
3318
|
+
return this.storage.has(LoginTokenStorage.TOKEN_KEY) ? this.storage.get(LoginTokenStorage.TOKEN_KEY) : this.cookies.get(LoginTokenStorage.TOKEN_KEY);
|
|
3317
3319
|
}
|
|
3318
3320
|
save(value) {
|
|
3319
|
-
|
|
3320
|
-
|
|
3321
|
-
}
|
|
3322
|
-
finally {
|
|
3323
|
-
this.cookies.put(LoginTokenStorage.TOKEN_KEY, value);
|
|
3324
|
-
}
|
|
3321
|
+
this.storage.set(LoginTokenStorage.TOKEN_KEY, value);
|
|
3322
|
+
this.cookies.put(LoginTokenStorage.TOKEN_KEY, value);
|
|
3325
3323
|
}
|
|
3326
|
-
|
|
3327
|
-
|
|
3328
|
-
|
|
3329
|
-
}
|
|
3330
|
-
finally {
|
|
3331
|
-
this.cookies.remove(LoginTokenStorage.TOKEN_KEY);
|
|
3324
|
+
destroy() {
|
|
3325
|
+
if (this.isDestroyed) {
|
|
3326
|
+
return;
|
|
3332
3327
|
}
|
|
3328
|
+
super.destroy();
|
|
3329
|
+
this.storage = null;
|
|
3330
|
+
this.cookies = null;
|
|
3333
3331
|
}
|
|
3334
3332
|
}
|
|
3335
3333
|
//--------------------------------------------------------------------------
|