rename authenticate to authorize

This commit is contained in:
Jonathan Rainville 2018-09-06 16:13:44 -04:00
parent ddde6d7bdd
commit 0a6196d48d
3 changed files with 11 additions and 11 deletions

View File

@ -13,11 +13,11 @@ function action(type, payload = {}) {
return {type, ...payload}; return {type, ...payload};
} }
export const AUTHENTICATE = createRequestTypes('AUTHENTICATE'); export const AUTHORIZE = createRequestTypes('AUTHORIZE');
export const authenticate = { export const authorize = {
request: (token, callback) => action(AUTHENTICATE[REQUEST], {token, callback}), request: (token, callback) => action(AUTHORIZE[REQUEST], {token, callback}),
success: () => action(AUTHENTICATE[SUCCESS]), success: () => action(AUTHORIZE[SUCCESS]),
failure: (error) => action(AUTHENTICATE[FAILURE], {error}) failure: (error) => action(AUTHORIZE[FAILURE], {error})
}; };
export const ACCOUNTS = createRequestTypes('ACCOUNTS'); export const ACCOUNTS = createRequestTypes('ACCOUNTS');

View File

@ -10,7 +10,7 @@ import {put as cachePut, get as cacheGet} from '../services/cache';
import { import {
initBlockHeader, initBlockHeader,
authenticate, authorize,
processes as processesAction, processes as processesAction,
versions as versionsAction, versions as versionsAction,
plugins as pluginsAction plugins as pluginsAction
@ -30,7 +30,7 @@ class AppContainer extends Component {
} else { } else {
token = cacheGet('token'); token = cacheGet('token');
} }
this.props.authenticate(token, (err) => { this.props.authorize(token, (err) => {
if (err) { if (err) {
return this.setState({authenticateError: err}); return this.setState({authenticateError: err});
} }
@ -63,7 +63,7 @@ class AppContainer extends Component {
} }
AppContainer.propTypes = { AppContainer.propTypes = {
authenticate: PropTypes.func, authorize: PropTypes.func,
initBlockHeader: PropTypes.func, initBlockHeader: PropTypes.func,
fetchProcesses: PropTypes.func, fetchProcesses: PropTypes.func,
fetchPlugins: PropTypes.func, fetchPlugins: PropTypes.func,
@ -75,7 +75,7 @@ export default withRouter(connect(
null, null,
{ {
initBlockHeader, initBlockHeader,
authenticate: authenticate.request, authorize: authorize.request,
fetchProcesses: processesAction.request, fetchProcesses: processesAction.request,
fetchVersions: versionsAction.request, fetchVersions: versionsAction.request,
fetchPlugins: pluginsAction.request fetchPlugins: pluginsAction.request

View File

@ -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 postFile = doRequest.bind(null, actions.saveFile, api.postFile);
export const deleteFile = doRequest.bind(null, actions.removeFile, api.deleteFile); export const deleteFile = doRequest.bind(null, actions.removeFile, api.deleteFile);
export const fetchEthGas = doRequest.bind(null, actions.gasOracle, api.getEthGasAPI); 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 fetchCurrentFile = doRequest.bind(null, actions.currentFile, storage.fetchCurrentFile);
export const postCurrentFile = doRequest.bind(null, actions.saveCurrentFile, storage.postCurrentFile); export const postCurrentFile = doRequest.bind(null, actions.saveCurrentFile, storage.postCurrentFile);
@ -172,7 +172,7 @@ export function *watchFetchEthGas() {
} }
export function *watchAuthenticate() { export function *watchAuthenticate() {
yield takeEvery(actions.AUTHENTICATE[actions.REQUEST], authenticate); yield takeEvery(actions.AUTHORIZE[actions.REQUEST], authorize);
} }
function createChannel(socket) { function createChannel(socket) {