mirror of
				https://github.com/Unleash/unleash.git
				synced 2025-10-27 11:02:16 +01:00 
			
		
		
		
	fix: add security wanring to the console
This commit is contained in:
		
							parent
							
								
									87c32015a4
								
							
						
					
					
						commit
						0a2672270e
					
				@ -14,6 +14,7 @@ import store from './store';
 | 
				
			|||||||
import MetricsPoller from './metrics-poller';
 | 
					import MetricsPoller from './metrics-poller';
 | 
				
			||||||
import App from './component/app';
 | 
					import App from './component/app';
 | 
				
			||||||
import ScrollToTop from './component/scroll-to-top';
 | 
					import ScrollToTop from './component/scroll-to-top';
 | 
				
			||||||
 | 
					import { writeWarning } from './security-logger';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
let composeEnhancers;
 | 
					let composeEnhancers;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -21,6 +22,7 @@ if (process.env.NODE_ENV !== 'production' && window.__REDUX_DEVTOOLS_EXTENSION_C
 | 
				
			|||||||
    composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__;
 | 
					    composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__;
 | 
				
			||||||
} else {
 | 
					} else {
 | 
				
			||||||
    composeEnhancers = compose;
 | 
					    composeEnhancers = compose;
 | 
				
			||||||
 | 
					    writeWarning();
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const unleashStore = createStore(store, composeEnhancers(applyMiddleware(thunkMiddleware)));
 | 
					const unleashStore = createStore(store, composeEnhancers(applyMiddleware(thunkMiddleware)));
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										9
									
								
								frontend/src/security-logger.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										9
									
								
								frontend/src/security-logger.js
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,9 @@
 | 
				
			|||||||
 | 
					export const writeWarning = () => {
 | 
				
			||||||
 | 
					    // eslint-disable-next-line no-console
 | 
				
			||||||
 | 
					    console.log(
 | 
				
			||||||
 | 
					        `%cThis is a warning!
 | 
				
			||||||
 | 
					Please do not use any JavaScript using copy/paste
 | 
				
			||||||
 | 
					from elsewhere on the web or any person.`,
 | 
				
			||||||
 | 
					        'color:white;font-size: 1.8em;background:red'
 | 
				
			||||||
 | 
					    );
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
		Loading…
	
		Reference in New Issue
	
	Block a user