zek 14.2.65 → 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/components/edit-base.component.mjs +1 -1
- package/esm2020/lib/services/auth.service.mjs +18 -12
- package/esm2020/lib/services/crud.service.mjs +1 -1
- package/fesm2015/zek.mjs +17 -11
- package/fesm2015/zek.mjs.map +1 -1
- package/fesm2020/zek.mjs +17 -11
- 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
|
@@ -1138,25 +1138,31 @@ class AuthService {
|
|
|
1138
1138
|
}
|
|
1139
1139
|
_starRefreshTokenTimer() {
|
|
1140
1140
|
this._stopRefreshTokenTimer();
|
|
1141
|
-
let user = this.
|
|
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() {
|
|
1159
|
-
let expired = this.getExpired() || new Date(0);
|
|
1165
|
+
let expired = this.getExpired() || new Date(0); // if getExpired is null return min JS date
|
|
1160
1166
|
const newValue = new Date() < expired;
|
|
1161
1167
|
if (this._oldValueIsAuthenticated !== newValue) {
|
|
1162
1168
|
this._oldValueIsAuthenticated = newValue;
|