mirror of
https://github.com/status-im/embark-area-51.git
synced 2025-02-17 09:46:37 +00:00
Add missing error on authentication
This commit is contained in:
parent
4ca753f38f
commit
02aea0506f
@ -24,6 +24,9 @@ class Login extends React.Component {
|
|||||||
<div className="login-container d-flex flex-column-reverse flex-md-row">
|
<div className="login-container d-flex flex-column-reverse flex-md-row">
|
||||||
<div className="login-layout-container-section flex-fill">
|
<div className="login-layout-container-section flex-fill">
|
||||||
<h2>Login</h2>
|
<h2>Login</h2>
|
||||||
|
{this.props.error &&
|
||||||
|
<p className="text-danger">{this.props.error}</p>
|
||||||
|
}
|
||||||
<div className="mt-4">
|
<div className="mt-4">
|
||||||
<form onSubmit={(e) => this.handleSubmit(e)}>
|
<form onSubmit={(e) => this.handleSubmit(e)}>
|
||||||
<div className="form-group">
|
<div className="form-group">
|
||||||
|
@ -75,24 +75,22 @@ class AppContainer extends Component {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
renderBody() {
|
||||||
let content;
|
|
||||||
if (this.shouldRenderLogin()) {
|
if (this.shouldRenderLogin()) {
|
||||||
content = <Login credentials={this.props.credentials} authenticate={this.props.authenticate} error={this.props.authenticationError} />;
|
return <Login credentials={this.props.credentials} authenticate={this.props.authenticate} error={this.props.authenticationError} />;
|
||||||
} else {
|
}
|
||||||
content = <Layout location={this.props.location}
|
return (
|
||||||
|
<Layout location={this.props.location}
|
||||||
logout={this.props.logout}
|
logout={this.props.logout}
|
||||||
toggleTheme={() => this.toggleTheme()}
|
toggleTheme={() => this.toggleTheme()}
|
||||||
currentTheme={this.props.theme}>
|
currentTheme={this.props.theme}>
|
||||||
<React.Fragment>{routes}</React.Fragment>
|
<React.Fragment>{routes}</React.Fragment>
|
||||||
</Layout>;
|
</Layout>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
render() {
|
||||||
<div className={(this.props.theme) + "-theme"}>
|
return <div className={(this.props.theme) + "-theme"}>{this.renderBody()}</div>;
|
||||||
{content}
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -111,7 +109,7 @@ AppContainer.propTypes = {
|
|||||||
location: PropTypes.object,
|
location: PropTypes.object,
|
||||||
theme: PropTypes.string,
|
theme: PropTypes.string,
|
||||||
changeTheme: PropTypes.func,
|
changeTheme: PropTypes.func,
|
||||||
fetchTheme: PropTypes.func
|
fetchTheme: PropTypes.func,
|
||||||
};
|
};
|
||||||
|
|
||||||
function mapStateToProps(state) {
|
function mapStateToProps(state) {
|
||||||
@ -119,7 +117,7 @@ function mapStateToProps(state) {
|
|||||||
initialized: getVersions(state).length > 0,
|
initialized: getVersions(state).length > 0,
|
||||||
credentials: getCredentials(state),
|
credentials: getCredentials(state),
|
||||||
authenticationError: getAuthenticationError(state),
|
authenticationError: getAuthenticationError(state),
|
||||||
theme: getTheme(state)
|
theme: getTheme(state),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@ function *doRequest(entity, serviceFn, payload) {
|
|||||||
if(response) {
|
if(response) {
|
||||||
yield put(entity.success(response.data, payload));
|
yield put(entity.success(response.data, payload));
|
||||||
} else if (error) {
|
} else if (error) {
|
||||||
yield put(entity.failure(error.message));
|
yield put(entity.failure(error.message || error));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user