@koalarx/ui 13.2.0 → 13.2.3
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/core/esm2020/lib/services/openid/koala.oauth2.service.mjs +17 -23
- package/core/fesm2015/koalarx-ui-core.mjs +20 -24
- package/core/fesm2015/koalarx-ui-core.mjs.map +1 -1
- package/core/fesm2020/koalarx-ui-core.mjs +15 -21
- package/core/fesm2020/koalarx-ui-core.mjs.map +1 -1
- package/list/esm2020/lib/list.abstract.mjs +2 -5
- package/list/fesm2015/koalarx-ui-list.mjs +2 -4
- package/list/fesm2015/koalarx-ui-list.mjs.map +1 -1
- package/list/fesm2020/koalarx-ui-list.mjs +1 -4
- package/list/fesm2020/koalarx-ui-list.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -375,12 +375,8 @@ class KoalaOAuth2Service {
|
|
|
375
375
|
this.generateState();
|
|
376
376
|
}
|
|
377
377
|
ngOnDestroy() {
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
}
|
|
381
|
-
if (this.refreshTokenInterval) {
|
|
382
|
-
clearInterval(this.refreshTokenInterval);
|
|
383
|
-
}
|
|
378
|
+
this.eventSubscription?.unsubscribe();
|
|
379
|
+
this.refreshTokenInterval?.unsubscribe();
|
|
384
380
|
}
|
|
385
381
|
hasOpenIdConfig() {
|
|
386
382
|
return !!this.openIdOptions;
|
|
@@ -474,26 +470,24 @@ class KoalaOAuth2Service {
|
|
|
474
470
|
}, 300);
|
|
475
471
|
}
|
|
476
472
|
initRefreshTokenInterval(code, refreshToken) {
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
}
|
|
473
|
+
this.refreshTokenInterval?.unsubscribe();
|
|
474
|
+
this.refreshTokenInterval = interval(1000).subscribe(() => {
|
|
475
|
+
const refreshTokenDate = new Date();
|
|
476
|
+
refreshTokenDate.setMinutes(refreshTokenDate.getMinutes() + 1);
|
|
477
|
+
const token = this.tokenService.getOAuth2Token();
|
|
478
|
+
if (token) {
|
|
479
|
+
const expires_in = token.expired;
|
|
480
|
+
if (expires_in) {
|
|
481
|
+
if (new Date(expires_in) <= refreshTokenDate) {
|
|
482
|
+
this.getToken(code, refreshToken);
|
|
488
483
|
}
|
|
489
484
|
}
|
|
490
|
-
}
|
|
491
|
-
}
|
|
485
|
+
}
|
|
486
|
+
});
|
|
492
487
|
}
|
|
493
488
|
getToken(code, refreshToken) {
|
|
494
489
|
if (refreshToken) {
|
|
495
|
-
|
|
496
|
-
this.refreshTokenInterval = null;
|
|
490
|
+
this.refreshTokenInterval?.unsubscribe();
|
|
497
491
|
}
|
|
498
492
|
const formData = new URLSearchParams();
|
|
499
493
|
let data = koala({
|