diff --git a/changelog/13950.txt b/changelog/13950.txt new file mode 100644 index 000000000..02ed84d1c --- /dev/null +++ b/changelog/13950.txt @@ -0,0 +1,3 @@ +```release-note:bug +ui: trigger token renewal if inactive and half of TTL has passed +``` \ No newline at end of file diff --git a/ui/app/services/auth.js b/ui/app/services/auth.js index b2a1a99ff..ee1fb727c 100644 --- a/ui/app/services/auth.js +++ b/ui/app/services/auth.js @@ -292,9 +292,10 @@ export default Service.extend({ }, setLastFetch(timestamp) { + const now = this.now(); this.set('lastFetch', timestamp); - // if expiration was allowed we want to go ahead and renew here - if (this.allowExpiration) { + // if expiration was allowed and we're over half the ttl we want to go ahead and renew here + if (this.allowExpiration && now >= this.renewAfterEpoch) { this.renew(); } this.set('allowExpiration', false);