From 6b7b37d167721c7a4cb656d1b83cde90a891b1f0 Mon Sep 17 00:00:00 2001 From: Chelsea Shaw <82459713+hashishaw@users.noreply.github.com> Date: Fri, 9 Feb 2024 18:38:55 +0000 Subject: [PATCH] backport of commit f4248bf16c79d7349a217477b347bf0bfb155581 --- changelog/25335.txt | 3 +++ ui/app/components/token-expire-warning.hbs | 8 +++++++- ui/app/components/token-expire-warning.js | 5 +++++ 3 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 changelog/25335.txt diff --git a/changelog/25335.txt b/changelog/25335.txt new file mode 100644 index 000000000000..b931d47f4a7a --- /dev/null +++ b/changelog/25335.txt @@ -0,0 +1,3 @@ +```release-note:improvement +ui: redirect back to current route after reauthentication when token expires +``` diff --git a/ui/app/components/token-expire-warning.hbs b/ui/app/components/token-expire-warning.hbs index 43d68c20397b..3d56bd129fbb 100644 --- a/ui/app/components/token-expire-warning.hbs +++ b/ui/app/components/token-expire-warning.hbs @@ -10,7 +10,13 @@ Your auth token expired on {{date-format @expirationDate "MMMM do yyyy, h:mm:ss a"}}. You will need to re-authenticate. - + {{else}}
diff --git a/ui/app/components/token-expire-warning.js b/ui/app/components/token-expire-warning.js index 5b9419bd9cf2..2fb4bd8adf48 100644 --- a/ui/app/components/token-expire-warning.js +++ b/ui/app/components/token-expire-warning.js @@ -36,6 +36,11 @@ export default class TokenExpireWarning extends Component { yield this.handleRenew(); } + get queryParams() { + // Bring user back to current page after login + return { redirect_to: this.router.currentURL }; + } + get showWarning() { const currentRoute = this.router.currentRouteName; if ('vault.cluster.oidc-provider' === currentRoute) {