mirror of
				https://github.com/optim-enterprises-bv/vault.git
				synced 2025-11-03 20:17:59 +00:00 
			
		
		
		
	* add ember-cli-content-security-policy * only enable client side CSP when not in production - the go side handles this otherwise * add service that handles and stores CSP violations via the securitypolicyviolation event * update auth form component to show a specialized message when there's a CSP error * move to computed prop for showing the CSP error message * fix typos
		
			
				
	
	
		
			32 lines
		
	
	
		
			674 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			32 lines
		
	
	
		
			674 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
import Ember from 'ember';
 | 
						|
 | 
						|
export default Ember.Component.extend({
 | 
						|
  model: null,
 | 
						|
  errors: [],
 | 
						|
  errorMessage: null,
 | 
						|
 | 
						|
  displayErrors: Ember.computed(
 | 
						|
    'errorMessage',
 | 
						|
    'model.isError',
 | 
						|
    'model.adapterError.errors.@each',
 | 
						|
    'errors',
 | 
						|
    'errors.@each',
 | 
						|
    function() {
 | 
						|
      const errorMessage = this.get('errorMessage');
 | 
						|
      const errors = this.get('errors');
 | 
						|
      const modelIsError = this.get('model.isError');
 | 
						|
      if (errorMessage) {
 | 
						|
        return [errorMessage];
 | 
						|
      }
 | 
						|
 | 
						|
      if (errors && errors.length > 0) {
 | 
						|
        return errors;
 | 
						|
      }
 | 
						|
 | 
						|
      if (modelIsError) {
 | 
						|
        return this.get('model.adapterError.errors');
 | 
						|
      }
 | 
						|
    }
 | 
						|
  ),
 | 
						|
});
 |