diff --git a/embark-ui/src/actions/index.js b/embark-ui/src/actions/index.js index 983f6547..3c918c75 100644 --- a/embark-ui/src/actions/index.js +++ b/embark-ui/src/actions/index.js @@ -13,11 +13,11 @@ function action(type, payload = {}) { return {type, ...payload}; } -export const AUTHENTICATE = createRequestTypes('AUTHENTICATE'); -export const authenticate = { - request: (token, callback) => action(AUTHENTICATE[REQUEST], {token, callback}), - success: () => action(AUTHENTICATE[SUCCESS]), - failure: (error) => action(AUTHENTICATE[FAILURE], {error}) +export const AUTHORIZE = createRequestTypes('AUTHORIZE'); +export const authorize = { + request: (token, callback) => action(AUTHORIZE[REQUEST], {token, callback}), + success: () => action(AUTHORIZE[SUCCESS]), + failure: (error) => action(AUTHORIZE[FAILURE], {error}) }; export const ACCOUNTS = createRequestTypes('ACCOUNTS'); diff --git a/embark-ui/src/containers/AppContainer.js b/embark-ui/src/containers/AppContainer.js index ce80f5e3..46928750 100644 --- a/embark-ui/src/containers/AppContainer.js +++ b/embark-ui/src/containers/AppContainer.js @@ -10,7 +10,7 @@ import {put as cachePut, get as cacheGet} from '../services/cache'; import { initBlockHeader, - authenticate, + authorize, processes as processesAction, versions as versionsAction, plugins as pluginsAction @@ -30,7 +30,7 @@ class AppContainer extends Component { } else { token = cacheGet('token'); } - this.props.authenticate(token, (err) => { + this.props.authorize(token, (err) => { if (err) { return this.setState({authenticateError: err}); } @@ -63,7 +63,7 @@ class AppContainer extends Component { } AppContainer.propTypes = { - authenticate: PropTypes.func, + authorize: PropTypes.func, initBlockHeader: PropTypes.func, fetchProcesses: PropTypes.func, fetchPlugins: PropTypes.func, @@ -75,7 +75,7 @@ export default withRouter(connect( null, { initBlockHeader, - authenticate: authenticate.request, + authorize: authorize.request, fetchProcesses: processesAction.request, fetchVersions: versionsAction.request, fetchPlugins: pluginsAction.request diff --git a/embark-ui/src/sagas/index.js b/embark-ui/src/sagas/index.js index 48580706..0502c081 100644 --- a/embark-ui/src/sagas/index.js +++ b/embark-ui/src/sagas/index.js @@ -39,7 +39,7 @@ export const fetchFile = doRequest.bind(null, actions.file, api.fetchFile); export const postFile = doRequest.bind(null, actions.saveFile, api.postFile); export const deleteFile = doRequest.bind(null, actions.removeFile, api.deleteFile); export const fetchEthGas = doRequest.bind(null, actions.gasOracle, api.getEthGasAPI); -export const authenticate = doRequest.bind(null, actions.authenticate, api.authorize); +export const authorize = doRequest.bind(null, actions.authorize, api.authorize); export const fetchCurrentFile = doRequest.bind(null, actions.currentFile, storage.fetchCurrentFile); export const postCurrentFile = doRequest.bind(null, actions.saveCurrentFile, storage.postCurrentFile); @@ -172,7 +172,7 @@ export function *watchFetchEthGas() { } export function *watchAuthenticate() { - yield takeEvery(actions.AUTHENTICATE[actions.REQUEST], authenticate); + yield takeEvery(actions.AUTHORIZE[actions.REQUEST], authorize); } function createChannel(socket) {