5ca987662f
* move warning banner out of token-expire-warning and into user menu * check renewal status every 5s, and resume auto-renew if a user becomes active again * use a link in the token-expire-warning * add test for new expiration functionality * fix license test * use features helper in license test * fix import * use yarn 1.12.1 * remove mirage * skip some tests for now * use eslintignore * logout after auth tests * use new alert-banner for auth info warning * add data-test selector back * move identity back to a button, and style button.link * make the warning message the right color * fix shamir test * review feedback
46 lines
1 KiB
JavaScript
46 lines
1 KiB
JavaScript
import { inject as service } from '@ember/service';
|
|
import { or } from '@ember/object/computed';
|
|
import Component from '@ember/component';
|
|
import { run } from '@ember/runloop';
|
|
import { computed } from '@ember/object';
|
|
|
|
export default Component.extend({
|
|
auth: service(),
|
|
wizard: service(),
|
|
router: service(),
|
|
version: service(),
|
|
|
|
transitionToRoute: function() {
|
|
this.get('router').transitionTo(...arguments);
|
|
},
|
|
|
|
classNames: 'user-menu auth-info',
|
|
|
|
isRenewing: or('fakeRenew', 'auth.isRenewing'),
|
|
|
|
canExpire: computed.alias('auth.allowExpiration'),
|
|
|
|
isOSS: computed.alias('version.isOSS'),
|
|
|
|
actions: {
|
|
restartGuide() {
|
|
this.get('wizard').restartGuide();
|
|
},
|
|
renewToken() {
|
|
this.set('fakeRenew', true);
|
|
run.later(() => {
|
|
this.set('fakeRenew', false);
|
|
this.get('auth').renew();
|
|
}, 200);
|
|
},
|
|
|
|
revokeToken() {
|
|
this.get('auth')
|
|
.revokeCurrentToken()
|
|
.then(() => {
|
|
this.transitionToRoute('vault.cluster.logout');
|
|
});
|
|
},
|
|
},
|
|
});
|