zek 14.2.64 → 14.2.66

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/fesm2020/zek.mjs CHANGED
@@ -1138,9 +1138,11 @@ class AuthService {
1138
1138
  }
1139
1139
  _starRefreshTokenTimer() {
1140
1140
  this._stopRefreshTokenTimer();
1141
- let user = this.user;
1141
+ let user = this._user;
1142
1142
  if (user && user.refreshTokenTime) {
1143
- const timeout = user.refreshTokenTime.getTime() - Date.now(); // - (60 * 1000);
1143
+ let timeout = user.refreshTokenTime.getTime() - Date.now(); // - (60 * 1000);
1144
+ if (timeout < 0)
1145
+ timeout = 0;
1144
1146
  this._refreshTokenTimeout = setTimeout(() => {
1145
1147
  if (this._onRefreshTokenSubject) {
1146
1148
  this._onRefreshTokenSubject.next();
@@ -1154,7 +1156,7 @@ class AuthService {
1154
1156
  }
1155
1157
  }
1156
1158
  isAuthenticated() {
1157
- let expired = this.getExpired() || new Date(0);
1159
+ let expired = this.getExpired() || new Date(0); // if getExpired is null return min JS date
1158
1160
  const newValue = new Date() < expired;
1159
1161
  if (this._oldValueIsAuthenticated !== newValue) {
1160
1162
  this._oldValueIsAuthenticated = newValue;