open-vault/ui/app/routes/vault/cluster/auth.js
Matthew Irish d509588cd2
Ember update (#5386)
Ember update - update ember-cli, ember-data, and ember to 3.4 series
2018-09-25 11:28:26 -05:00

44 lines
1.1 KiB
JavaScript

import { inject as service } from '@ember/service';
import ClusterRouteBase from './cluster-route-base';
import config from 'vault/config/environment';
export default ClusterRouteBase.extend({
queryParams: {
authMethod: {
replace: true,
},
},
flashMessages: service(),
version: service(),
wizard: service(),
beforeModel() {
return this._super().then(() => {
return this.get('version').fetchFeatures();
});
},
model() {
return this._super(...arguments);
},
resetController(controller) {
controller.set('wrappedToken', '');
controller.set('authMethod', '');
},
afterModel() {
if (config.welcomeMessage) {
this.get('flashMessages').stickyInfo(config.welcomeMessage);
}
},
activate() {
this.get('wizard').set('initEvent', 'LOGIN');
this.get('wizard').transitionTutorialMachine(this.get('wizard.currentState'), 'TOLOGIN');
},
actions: {
willTransition(transition) {
if (transition.targetName !== this.routeName) {
this.get('wizard').transitionTutorialMachine(this.get('wizard.currentState'), 'INITDONE');
}
},
},
});