2018-09-25 16:28:26 +00:00
|
|
|
import { inject as service } from '@ember/service';
|
|
|
|
import Component from '@ember/component';
|
2018-04-03 14:16:57 +00:00
|
|
|
|
2018-09-25 16:28:26 +00:00
|
|
|
export default Component.extend({
|
|
|
|
auth: service(),
|
|
|
|
router: service(),
|
2018-05-30 17:26:54 +00:00
|
|
|
classNames: 'token-expire-warning',
|
2018-04-03 14:16:57 +00:00
|
|
|
|
|
|
|
transitionToRoute: function() {
|
2018-09-25 16:28:26 +00:00
|
|
|
this.get('router').transitionTo(...arguments);
|
2018-04-03 14:16:57 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
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);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
});
|