Unverified Commit 019e9749 authored by hc-github-team-secure-vault-core's avatar hc-github-team-secure-vault-core Committed by GitHub
Browse files

Backport of Logout with wrapped token into release/1.8.x (#14341)


* backport of commit eaf5f1a50f72c4ebcae6c6c7d2fa6e5e94382ba5

* backport of commit a0e6d1b6b93fd84967314aca28dc4b7f58fbe6b0
Co-authored-by: default avatarJordan Reimer <zofskeez@gmail.com>
parent 42cd08b4
Branches unavailable v1.8.11 v1.8.10
No related merge requests found
Showing with 13 additions and 8 deletions
+13 -8
```release-note:bug
ui: Fixes issue logging out with wrapped token query parameter
```
\ No newline at end of file
......@@ -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 }));
}
},
});
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment