From eaf5f1a50f72c4ebcae6c6c7d2fa6e5e94382ba5 Mon Sep 17 00:00:00 2001 From: Jordan Reimer Date: Tue, 1 Mar 2022 13:40:10 -0700 Subject: [PATCH 1/2] fixes issue passing wrapped_token query param to logout route --- ui/app/routes/vault/cluster/logout.js | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/ui/app/routes/vault/cluster/logout.js b/ui/app/routes/vault/cluster/logout.js index 85da83a993dd..11913ffa43a9 100644 --- a/ui/app/routes/vault/cluster/logout.js +++ b/ui/app/routes/vault/cluster/logout.js @@ -11,14 +11,14 @@ export default Route.extend(ModelBoundaryRoute, { console: service(), permissions: service(), namespaceService: service('namespace'), + router: service(), modelTypes: computed(function () { return ['secret', 'secret-engine']; }), - beforeModel() { + beforeModel({ to: { queryParams } }) { const authType = this.auth.getAuthType(); - const baseUrl = window.location.origin; const ns = this.namespaceService.path; this.auth.deleteCurrentToken(); this.controlGroup.deleteTokens(); @@ -27,15 +27,17 @@ export default Route.extend(ModelBoundaryRoute, { this.console.clearLog(true); this.flashMessages.clearMessages(); this.permissions.reset(); + + queryParams.with = authType; + if (ns) { + queryParams.namespace = ns; + } if (Ember.testing) { // Don't redirect on the test - this.replaceWith('vault.cluster.auth', { queryParams: { with: authType } }); + this.replaceWith('vault.cluster.auth', { queryParams }); } else { - let params = `?with=${authType}`; - if (ns) { - params = `${params}&namespace=${ns}`; - } - location.assign(`${baseUrl}/ui/vault/auth${params}`); + const { cluster_name } = this.paramsFor('vault.cluster'); + location.assign(this.router.urlFor('vault.cluster.auth', cluster_name, { queryParams })); } }, }); From a0e6d1b6b93fd84967314aca28dc4b7f58fbe6b0 Mon Sep 17 00:00:00 2001 From: Jordan Reimer Date: Tue, 1 Mar 2022 15:04:56 -0700 Subject: [PATCH 2/2] adds changelog entry --- changelog/14329.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 changelog/14329.txt diff --git a/changelog/14329.txt b/changelog/14329.txt new file mode 100644 index 000000000000..87917be5db05 --- /dev/null +++ b/changelog/14329.txt @@ -0,0 +1,3 @@ +```release-note:bug +ui: Fixes issue logging out with wrapped token query parameter +``` \ No newline at end of file