3da6487cf4
* add redirect_to query param * alias auth controller state to vault controller where the query param is defined * capture the current url before redirecting a user to auth if they're being redirected * consume and reset the redirectTo query param when authenticating * make sure that the current url when logging out does not get set as the redirect_to query param * add unit tests for the mixin and make it so that redirects from the root don't end up in redirect_to * acceptance tests for redirect
27 lines
791 B
JavaScript
27 lines
791 B
JavaScript
import { inject as service } from '@ember/service';
|
|
import Controller from '@ember/controller';
|
|
import { computed } from '@ember/object';
|
|
import config from '../config/environment';
|
|
|
|
export default Controller.extend({
|
|
queryParams: [
|
|
{
|
|
wrappedToken: 'wrapped_token',
|
|
redirectTo: 'redirect_to',
|
|
},
|
|
],
|
|
wrappedToken: '',
|
|
redirectTo: '',
|
|
env: config.environment,
|
|
auth: service(),
|
|
store: service(),
|
|
activeCluster: computed('auth.activeCluster', function() {
|
|
let id = this.get('auth.activeCluster');
|
|
return id ? this.get('store').peekRecord('cluster', id) : null;
|
|
}),
|
|
activeClusterName: computed('activeCluster', function() {
|
|
const activeCluster = this.get('activeCluster');
|
|
return activeCluster ? activeCluster.get('name') : null;
|
|
}),
|
|
});
|