2018-07-05 18:28:12 +00:00
|
|
|
import ClusterRouteBase from './cluster-route-base';
|
|
|
|
import Ember from 'ember';
|
2018-07-20 21:48:25 +00:00
|
|
|
import config from 'vault/config/environment';
|
2018-07-05 18:28:12 +00:00
|
|
|
|
2018-07-20 21:48:25 +00:00
|
|
|
const { RSVP, inject } = Ember;
|
2018-07-05 18:28:12 +00:00
|
|
|
|
|
|
|
export default ClusterRouteBase.extend({
|
2018-07-20 21:48:25 +00:00
|
|
|
flashMessages: inject.service(),
|
2018-07-05 18:28:12 +00:00
|
|
|
beforeModel() {
|
2018-07-20 21:48:25 +00:00
|
|
|
this.store.unloadAll('auth-method');
|
|
|
|
return this._super();
|
2018-07-05 18:28:12 +00:00
|
|
|
},
|
|
|
|
model() {
|
|
|
|
let cluster = this._super(...arguments);
|
|
|
|
return this.store
|
|
|
|
.findAll('auth-method', {
|
|
|
|
adapterOptions: {
|
|
|
|
unauthenticated: true,
|
|
|
|
},
|
|
|
|
})
|
|
|
|
.then(result => {
|
|
|
|
return RSVP.hash({
|
|
|
|
cluster,
|
|
|
|
methods: result,
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
resetController(controller) {
|
|
|
|
controller.set('wrappedToken', '');
|
|
|
|
controller.set('authMethod', '');
|
|
|
|
},
|
2018-07-20 21:48:25 +00:00
|
|
|
|
|
|
|
afterModel() {
|
|
|
|
if (config.welcomeMessage) {
|
|
|
|
this.get('flashMessages').stickyInfo(config.welcomeMessage);
|
|
|
|
}
|
|
|
|
},
|
2018-07-05 18:28:12 +00:00
|
|
|
});
|