Skip to content

Commit

Permalink
feat: move JWT expiration checking to ZBR (part of HA) (#352)
Browse files Browse the repository at this point in the history
  • Loading branch information
rentallect authored Sep 11, 2024
1 parent 1f5fcc0 commit 9bc100e
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/runtime.js
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,21 @@ class ZitiBrowzerRuntime {
setTimeout(self._zbrPing, 1000, self );
}

_jwtExpirationCheck(self) {

if (isTokenExpired(self.zitiConfig.access_token)) {

let idpAuthHealthEvent = {
expired: true
};

self.idpAuthHealthEventHandler(idpAuthHealthEvent);

}

setTimeout(self._jwtExpirationCheck, 1000*30, self );
}

/**
* Determine if the specified DOM element contains the `download` attribute
*/
Expand Down Expand Up @@ -2089,6 +2104,8 @@ if (isUndefined(window.zitiBrowzerRuntime)) {

setTimeout(window.zitiBrowzerRuntime._getLatestBrowZerReleaseVersion, 1000, window.zitiBrowzerRuntime );

setTimeout(window.zitiBrowzerRuntime._jwtExpirationCheck, 1000, window.zitiBrowzerRuntime );

/**
*
*/
Expand Down

0 comments on commit 9bc100e

Please sign in to comment.