Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import React from 'react';
import cookie from 'js-cookie';
import Modernizr from 'modernizr';
import { Route, IndexRoute } from 'react-router';
import Sign from './components/Sign';
import UpdateMessage from './components/UpdateMessage';
import AppContainer from './containers/AppContainer';
import IndexPage from './containers/pages/IndexPage';
import BoardPage from './containers/pages/BoardPage';
import SignInPage from './containers/pages/SignInPage';
import SignUpPage from './containers/pages/SignUpPage';
import FullCardModal from './containers/modals/FullCardModal';
import { setPageIndex } from './actions/boardsActions';
const isFlexboxSupported = Modernizr.flexbox && Modernizr.flexwrap;
function ensureSignedIn(nextState, replace) {
if (!cookie.get('authenticated')) {
replace('/sign-in');
}
}
function ensureSignedOut(nextState, replace) {
if (cookie.get('authenticated')) {
replace('/');
}
}
function ensureBrowserIsUpdated(nextState, replace) {
if (!isFlexboxSupported) {
replace('/update');