mirror of
https://github.com/embarklabs/embark.git
synced 2025-01-24 12:40:21 +00:00
feat(cockpit): enable query param authentication in development mode
Prior to this commit it wasn't possible to authenticate using the `token` query param as the `host` used for authentication doesn't match the one of the Embark host.
This commit is contained in:
parent
ff0d7d20df
commit
8562a3f6c8
@ -6,3 +6,4 @@ export const DEPLOYMENT_PIPELINES = {
|
|||||||
injectedWeb3: 'injectedWeb3',
|
injectedWeb3: 'injectedWeb3',
|
||||||
embark: 'embark'
|
embark: 'embark'
|
||||||
}
|
}
|
||||||
|
export const DEFAULT_HOST = 'localhost:8000';
|
||||||
|
@ -5,6 +5,7 @@ import {withRouter} from "react-router-dom";
|
|||||||
import routes from '../routes';
|
import routes from '../routes';
|
||||||
import Login from '../components/Login';
|
import Login from '../components/Login';
|
||||||
import Layout from "../components/Layout";
|
import Layout from "../components/Layout";
|
||||||
|
import { DEFAULT_HOST } from '../constants';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
authenticate, fetchCredentials, logout,
|
authenticate, fetchCredentials, logout,
|
||||||
@ -33,7 +34,7 @@ class AppContainer extends Component {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const token = qs.parse(this.props.location.search, {ignoreQueryPrefix: true}).token;
|
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) {
|
if (token === this.props.credentials.token && this.props.credentials.host === host) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -3,11 +3,10 @@ import {REQUEST, SUCCESS, FAILURE, CONTRACT_COMPILE, FILES, LOGOUT, AUTHENTICATE
|
|||||||
FETCH_CREDENTIALS, UPDATE_BASE_ETHER, CHANGE_THEME, FETCH_THEME, EXPLORER_SEARCH,
|
FETCH_CREDENTIALS, UPDATE_BASE_ETHER, CHANGE_THEME, FETCH_THEME, EXPLORER_SEARCH,
|
||||||
SIGN_MESSAGE, VERIFY_MESSAGE, TOGGLE_BREAKPOINT,
|
SIGN_MESSAGE, VERIFY_MESSAGE, TOGGLE_BREAKPOINT,
|
||||||
UPDATE_DEPLOYMENT_PIPELINE, WEB3_CONNECT, WEB3_DEPLOY, WEB3_ESTIMAGE_GAS} from "../actions";
|
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 BN_FACTOR = 10000;
|
||||||
const VOID_ADDRESS = '0x0000000000000000000000000000000000000000';
|
const VOID_ADDRESS = '0x0000000000000000000000000000000000000000';
|
||||||
const DEFAULT_HOST = 'localhost:8000';
|
|
||||||
const MAX_ELEMENTS = 200;
|
const MAX_ELEMENTS = 200;
|
||||||
|
|
||||||
const entitiesDefaultState = {
|
const entitiesDefaultState = {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user