From 2f195689594b4213897500ceeffc593847c3a40a Mon Sep 17 00:00:00 2001 From: Jonathan Rainville Date: Thu, 6 Sep 2018 16:13:44 -0400 Subject: [PATCH] rename authenticate to authorize --- embark-ui/src/actions/index.js | 10 +++++----- embark-ui/src/containers/AppContainer.js | 8 ++++---- embark-ui/src/sagas/index.js | 4 ++-- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/embark-ui/src/actions/index.js b/embark-ui/src/actions/index.js index 983f6547b..3c918c75e 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 ce80f5e3f..46928750e 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 485807068..0502c0815 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) {