rename authenticate to authorize
This commit is contained in:
parent
89cbbeec27
commit
2f19568959
|
@ -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');
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue