zek 14.2.66 → 14.2.67
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 +16 -10
- package/fesm2015/zek.mjs +15 -9
- package/fesm2015/zek.mjs.map +1 -1
- package/fesm2020/zek.mjs +15 -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,24 @@ 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
|
+
this._timerId = setInterval(this._emitRefreshToken, timeout);
|
|
1151
1152
|
}
|
|
1152
1153
|
}
|
|
1153
1154
|
_stopRefreshTokenTimer() {
|
|
1154
|
-
if (typeof this.
|
|
1155
|
-
|
|
1155
|
+
if (typeof this._timerId === 'number') {
|
|
1156
|
+
clearInterval(this._timerId);
|
|
1157
|
+
}
|
|
1158
|
+
}
|
|
1159
|
+
_emitRefreshToken() {
|
|
1160
|
+
if (this._onRefreshTokenSubject) {
|
|
1161
|
+
this._onRefreshTokenSubject.next();
|
|
1156
1162
|
}
|
|
1157
1163
|
}
|
|
1158
1164
|
isAuthenticated() {
|