diff --git a/embark-ui/src/constants.js b/embark-ui/src/constants.js index d6d789bd3..b2e1799d4 100644 --- a/embark-ui/src/constants.js +++ b/embark-ui/src/constants.js @@ -6,3 +6,4 @@ export const DEPLOYMENT_PIPELINES = { injectedWeb3: 'injectedWeb3', embark: 'embark' } +export const DEFAULT_HOST = 'localhost:8000'; diff --git a/embark-ui/src/containers/AppContainer.js b/embark-ui/src/containers/AppContainer.js index 36fa1e960..9ab22081e 100644 --- a/embark-ui/src/containers/AppContainer.js +++ b/embark-ui/src/containers/AppContainer.js @@ -5,6 +5,7 @@ import {withRouter} from "react-router-dom"; import routes from '../routes'; import Login from '../components/Login'; import Layout from "../components/Layout"; +import { DEFAULT_HOST } from '../constants'; import { authenticate, fetchCredentials, logout, @@ -33,7 +34,7 @@ class AppContainer extends Component { return; } const token = qs.parse(this.props.location.search, {ignoreQueryPrefix: true}).token; - const host = window.location.host; + const host = process.env.NODE_ENV === 'development' ? DEFAULT_HOST : window.location.host; if (token === this.props.credentials.token && this.props.credentials.host === host) { return; } diff --git a/embark-ui/src/reducers/index.js b/embark-ui/src/reducers/index.js index d4d6a8ff5..a41651c05 100644 --- a/embark-ui/src/reducers/index.js +++ b/embark-ui/src/reducers/index.js @@ -3,11 +3,10 @@ import {REQUEST, SUCCESS, FAILURE, CONTRACT_COMPILE, FILES, LOGOUT, AUTHENTICATE FETCH_CREDENTIALS, UPDATE_BASE_ETHER, CHANGE_THEME, FETCH_THEME, EXPLORER_SEARCH, SIGN_MESSAGE, VERIFY_MESSAGE, TOGGLE_BREAKPOINT, UPDATE_DEPLOYMENT_PIPELINE, WEB3_CONNECT, WEB3_DEPLOY, WEB3_ESTIMAGE_GAS} from "../actions"; -import {EMBARK_PROCESS_NAME, DARK_THEME, DEPLOYMENT_PIPELINES} from '../constants'; +import {EMBARK_PROCESS_NAME, DARK_THEME, DEPLOYMENT_PIPELINES, DEFAULT_HOST} from '../constants'; const BN_FACTOR = 10000; const VOID_ADDRESS = '0x0000000000000000000000000000000000000000'; -const DEFAULT_HOST = 'localhost:8000'; const MAX_ELEMENTS = 200; const entitiesDefaultState = {