1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-02-04 00:18:01 +01:00

fix: add security wanring to the console

This commit is contained in:
Ivar Conradi Østhus 2020-10-04 19:42:24 +02:00
parent 87c32015a4
commit 0a2672270e
2 changed files with 11 additions and 0 deletions

View File

@ -14,6 +14,7 @@ import store from './store';
import MetricsPoller from './metrics-poller';
import App from './component/app';
import ScrollToTop from './component/scroll-to-top';
import { writeWarning } from './security-logger';
let composeEnhancers;
@ -21,6 +22,7 @@ if (process.env.NODE_ENV !== 'production' && window.__REDUX_DEVTOOLS_EXTENSION_C
composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__;
} else {
composeEnhancers = compose;
writeWarning();
}
const unleashStore = createStore(store, composeEnhancers(applyMiddleware(thunkMiddleware)));

View 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'
);
};