mirror of
				https://github.com/optim-enterprises-bv/vault.git
				synced 2025-10-30 18:17:55 +00:00 
			
		
		
		
	 af1ad4e0f1
			
		
	
	af1ad4e0f1
	
	
	
		
			
			* 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);
 | |
|     },
 | |
|   },
 | |
| });
 |