@koalarx/ui 13.2.1 → 13.2.2
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 +13 -14
- package/core/fesm2015/koalarx-ui-core.mjs +13 -13
- package/core/fesm2015/koalarx-ui-core.mjs.map +1 -1
- package/core/fesm2020/koalarx-ui-core.mjs +12 -13
- package/core/fesm2020/koalarx-ui-core.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -470,21 +470,20 @@ class KoalaOAuth2Service {
|
|
|
470
470
|
}, 300);
|
|
471
471
|
}
|
|
472
472
|
initRefreshTokenInterval(code, refreshToken) {
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
}
|
|
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);
|
|
484
483
|
}
|
|
485
484
|
}
|
|
486
|
-
}
|
|
487
|
-
}
|
|
485
|
+
}
|
|
486
|
+
});
|
|
488
487
|
}
|
|
489
488
|
getToken(code, refreshToken) {
|
|
490
489
|
if (refreshToken) {
|