@ts-core/angular 15.0.30 → 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 +4 -22
- package/fesm2015/ts-core-angular.mjs +11 -20
- package/fesm2015/ts-core-angular.mjs.map +1 -1
- package/fesm2020/ts-core-angular.mjs +11 -20
- package/fesm2020/ts-core-angular.mjs.map +1 -1
- package/login/LoginTokenStorage.d.ts +0 -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
|
}
|
|
@@ -3307,28 +3315,11 @@ class LoginTokenStorage extends DestroyableContainer {
|
|
|
3307
3315
|
//
|
|
3308
3316
|
//--------------------------------------------------------------------------
|
|
3309
3317
|
get() {
|
|
3310
|
-
|
|
3311
|
-
try {
|
|
3312
|
-
value = this.storage.get(LoginTokenStorage.TOKEN_KEY);
|
|
3313
|
-
}
|
|
3314
|
-
catch (error) { }
|
|
3315
|
-
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);
|
|
3316
3319
|
}
|
|
3317
3320
|
save(value) {
|
|
3318
|
-
|
|
3319
|
-
|
|
3320
|
-
}
|
|
3321
|
-
finally {
|
|
3322
|
-
this.cookies.put(LoginTokenStorage.TOKEN_KEY, value);
|
|
3323
|
-
}
|
|
3324
|
-
}
|
|
3325
|
-
remove() {
|
|
3326
|
-
try {
|
|
3327
|
-
this.storage.remove(LoginTokenStorage.TOKEN_KEY);
|
|
3328
|
-
}
|
|
3329
|
-
finally {
|
|
3330
|
-
this.cookies.remove(LoginTokenStorage.TOKEN_KEY);
|
|
3331
|
-
}
|
|
3321
|
+
this.storage.set(LoginTokenStorage.TOKEN_KEY, value);
|
|
3322
|
+
this.cookies.put(LoginTokenStorage.TOKEN_KEY, value);
|
|
3332
3323
|
}
|
|
3333
3324
|
destroy() {
|
|
3334
3325
|
if (this.isDestroyed) {
|