open-vault/ui/app/components/token-expire-warning.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

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);
},
},
});