From 0c15b2af74b0f7124e59d27f3deff9fb60d9a338 Mon Sep 17 00:00:00 2001 From: Chelsea Shaw Date: Fri, 9 Feb 2024 12:02:21 -0600 Subject: [PATCH 1/2] Redirect after logging in from token expiry. Fixes #10963 --- ui/app/components/token-expire-warning.hbs | 8 +++++++- ui/app/components/token-expire-warning.js | 5 +++++ 2 files changed, 12 insertions(+), 1 deletion(-) 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) { From 9504f267bcfb1ba01cbed958168df648f647bc91 Mon Sep 17 00:00:00 2001 From: Chelsea Shaw Date: Fri, 9 Feb 2024 12:13:04 -0600 Subject: [PATCH 2/2] Add changelog --- changelog/25335.txt | 3 +++ 1 file changed, 3 insertions(+) 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 +```