85d7412107
* add error template to access so that we can see the sidebar even if you don't have permissions * identity template cleanup * make the token expiry warning friendlier and style it
33 lines
669 B
JavaScript
33 lines
669 B
JavaScript
import Ember from 'ember';
|
|
|
|
export default Ember.Component.extend({
|
|
classNames: 'token-expire-warning',
|
|
auth: Ember.inject.service(),
|
|
|
|
routing: Ember.inject.service('-routing'),
|
|
|
|
transitionToRoute: function() {
|
|
var router = this.get('routing.router');
|
|
router.transitionTo.apply(router, 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);
|
|
},
|
|
},
|
|
});
|