d509588cd2
Ember update - update ember-cli, ember-data, and ember to 3.4 series
32 lines
648 B
JavaScript
32 lines
648 B
JavaScript
import { inject as service } from '@ember/service';
|
|
import Component from '@ember/component';
|
|
|
|
export default Component.extend({
|
|
auth: service(),
|
|
router: service(),
|
|
classNames: 'token-expire-warning',
|
|
|
|
transitionToRoute: function() {
|
|
this.get('router').transitionTo(...arguments);
|
|
},
|
|
|
|
isDismissed: false,
|
|
|
|
actions: {
|
|
reauthenticate() {
|
|
this.get('auth').deleteCurrentToken();
|
|
this.transitionToRoute('vault.cluster');
|
|
},
|
|
|
|
renewToken() {
|
|
const auth = this.get('auth');
|
|
auth.renew();
|
|
auth.setLastFetch(Date.now());
|
|
},
|
|
|
|
dismiss() {
|
|
this.set('isDismissed', true);
|
|
},
|
|
},
|
|
});
|