zek 14.2.66 → 14.2.68
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/esm2020/lib/services/auth.service.mjs +18 -10
- package/fesm2015/zek.mjs +17 -9
- package/fesm2015/zek.mjs.map +1 -1
- package/fesm2020/zek.mjs +17 -9
- package/fesm2020/zek.mjs.map +1 -1
- package/lib/services/auth.service.d.ts +2 -1
- package/package.json +1 -1
package/fesm2020/zek.mjs
CHANGED
|
@@ -1141,18 +1141,26 @@ class AuthService {
|
|
|
1141
1141
|
let user = this._user;
|
|
1142
1142
|
if (user && user.refreshTokenTime) {
|
|
1143
1143
|
let timeout = user.refreshTokenTime.getTime() - Date.now(); // - (60 * 1000);
|
|
1144
|
-
if (timeout < 0)
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
}
|
|
1144
|
+
if (timeout < 0) {
|
|
1145
|
+
this._emitRefreshToken();
|
|
1146
|
+
}
|
|
1147
|
+
const minRefreshTime = 60000; //1 min;
|
|
1148
|
+
if (timeout < minRefreshTime) {
|
|
1149
|
+
timeout = minRefreshTime;
|
|
1150
|
+
}
|
|
1151
|
+
console.log('setInterval timeout', timeout);
|
|
1152
|
+
this._timerId = setInterval(this._emitRefreshToken, timeout);
|
|
1151
1153
|
}
|
|
1152
1154
|
}
|
|
1153
1155
|
_stopRefreshTokenTimer() {
|
|
1154
|
-
if (typeof this.
|
|
1155
|
-
|
|
1156
|
+
if (typeof this._timerId === 'number') {
|
|
1157
|
+
console.log('clearInterval timerId', this._timerId);
|
|
1158
|
+
clearInterval(this._timerId);
|
|
1159
|
+
}
|
|
1160
|
+
}
|
|
1161
|
+
_emitRefreshToken() {
|
|
1162
|
+
if (this._onRefreshTokenSubject) {
|
|
1163
|
+
this._onRefreshTokenSubject.next();
|
|
1156
1164
|
}
|
|
1157
1165
|
}
|
|
1158
1166
|
isAuthenticated() {
|