From 51ee69d02c9ebd98ac35a66a25f34fe7795204ab Mon Sep 17 00:00:00 2001 From: Chelsea Shaw <82459713+hashishaw@users.noreply.github.com> Date: Mon, 15 Apr 2024 16:04:10 -0500 Subject: [PATCH] UI: show banner when batch token expired (#26396) * allow token expiry for batch token * add changelog --- changelog/26396.txt | 3 +++ ui/app/services/auth.js | 5 +++++ 2 files changed, 8 insertions(+) create mode 100644 changelog/26396.txt diff --git a/changelog/26396.txt b/changelog/26396.txt new file mode 100644 index 0000000000..7f66e5cd58 --- /dev/null +++ b/changelog/26396.txt @@ -0,0 +1,3 @@ +```release-note:improvement +ui: show banner instead of permission denied error when batch token is expired +``` diff --git a/ui/app/services/auth.js b/ui/app/services/auth.js index 632f513f75..0230ca6c3b 100644 --- a/ui/app/services/auth.js +++ b/ui/app/services/auth.js @@ -298,6 +298,11 @@ export default Service.extend({ if (resp.renewable) { Object.assign(data, this.calculateExpiration(resp)); + } else if (resp.type === 'batch') { + // if it's a batch token, it's not renewable but has an expire time + // so manually set tokenExpirationEpoch and allow expiration + data.tokenExpirationEpoch = new Date(resp.expire_time).getTime(); + this.set('allowExpiration', true); } if (!data.displayName) {