mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-11-02 11:38:02 +00:00
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>
This commit is contained in:
@@ -16,6 +16,7 @@ export default Route.extend(ModelBoundaryRoute, {
|
||||
}),
|
||||
|
||||
beforeModel() {
|
||||
let authType = this.auth.getAuthType();
|
||||
this.auth.deleteCurrentToken();
|
||||
this.controlGroup.deleteTokens();
|
||||
this.namespaceService.reset();
|
||||
@@ -23,6 +24,6 @@ export default Route.extend(ModelBoundaryRoute, {
|
||||
this.console.clearLog(true);
|
||||
this.flashMessages.clearMessages();
|
||||
this.permissions.reset();
|
||||
this.replaceWith('vault.cluster.auth');
|
||||
this.replaceWith('vault.cluster.auth', { queryParams: { with: authType } });
|
||||
},
|
||||
});
|
||||
|
||||
@@ -333,6 +333,10 @@ export default Service.extend({
|
||||
return authData;
|
||||
},
|
||||
|
||||
getAuthType() {
|
||||
return this.get('authData.backend.type');
|
||||
},
|
||||
|
||||
deleteCurrentToken() {
|
||||
const tokenName = this.get('currentTokenName');
|
||||
this.deleteToken(tokenName);
|
||||
|
||||
Reference in New Issue
Block a user