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

28 lines
813 B
JavaScript
Raw Normal View History

import { computed } from '@ember/object';
import { inject as service } from '@ember/service';
import Route from '@ember/routing/route';
2018-04-03 14:16:57 +00:00
import ModelBoundaryRoute from 'vault/mixins/model-boundary-route';
export default Route.extend(ModelBoundaryRoute, {
auth: service(),
controlGroup: service(),
flashMessages: service(),
console: service(),
permissions: service(),
2018-04-03 14:16:57 +00:00
modelTypes: computed(function() {
return ['secret', 'secret-engine'];
}),
2018-04-03 14:16:57 +00:00
beforeModel() {
this.get('auth').deleteCurrentToken();
this.get('controlGroup').deleteTokens();
this.get('console').set('isOpen', false);
this.get('console').clearLog(true);
2018-04-03 14:16:57 +00:00
this.clearModelCache();
this.replaceWith('vault.cluster');
this.get('flashMessages').clearMessages();
this.get('permissions').reset();
2018-04-03 14:16:57 +00:00
},
});