Skip to content

Commit 84fdc89

Browse files
ui: make logout redirect to same auth method in login form (#8601)
* Make logging out of Web UI redirect to the login form using the same auth method that was previously used. This makes it less annoying to log back in again when your session expires. * Address PR feedback. Co-authored-by: Angel Garbarino <Monkeychip@users.noreply.github.com>
1 parent f82ad92 commit 84fdc89

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

ui/app/routes/vault/cluster/logout.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,14 @@ export default Route.extend(ModelBoundaryRoute, {
1616
}),
1717

1818
beforeModel() {
19+
let authType = this.auth.getAuthType();
1920
this.auth.deleteCurrentToken();
2021
this.controlGroup.deleteTokens();
2122
this.namespaceService.reset();
2223
this.console.set('isOpen', false);
2324
this.console.clearLog(true);
2425
this.flashMessages.clearMessages();
2526
this.permissions.reset();
26-
this.replaceWith('vault.cluster.auth');
27+
this.replaceWith('vault.cluster.auth', { queryParams: { with: authType } });
2728
},
2829
});

ui/app/services/auth.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,10 @@ export default Service.extend({
333333
return authData;
334334
},
335335

336+
getAuthType() {
337+
return this.get('authData.backend.type');
338+
},
339+
336340
deleteCurrentToken() {
337341
const tokenName = this.get('currentTokenName');
338342
this.deleteToken(tokenName);

0 commit comments

Comments
 (0)