|
@@ -91,6 +91,10 @@ class Login extends Component {
|
|
|
*
|
|
|
*/
|
|
|
handleFormReset = () => {
|
|
|
+ if (!this.authForm) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
this.authForm.reset()
|
|
|
}
|
|
|
|
|
@@ -99,13 +103,17 @@ class Login extends Component {
|
|
|
*/
|
|
|
render() {
|
|
|
const { from } = this.props.location.state || { from: { pathname: '/' }}
|
|
|
- const { isAuthenticated, notification, onHideNotification, classes } = this.props
|
|
|
+ const { isAuthenticated, isLoading, notification, onHideNotification, classes } = this.props
|
|
|
const { hasError } = this.state
|
|
|
|
|
|
if (isAuthenticated) {
|
|
|
return <Redirect to={from} />
|
|
|
}
|
|
|
|
|
|
+ if (isLoading) {
|
|
|
+ return <Typography align='center' variant='body1' color='primary'>Redireccionando...</Typography>
|
|
|
+ }
|
|
|
+
|
|
|
return (
|
|
|
<div className={classes.root}>
|
|
|
<Paper className={classes.paper} elevation={4}>
|
|
@@ -149,6 +157,7 @@ class Login extends Component {
|
|
|
const mapStateToProps = (state, props) => {
|
|
|
return {
|
|
|
isAuthenticated: state.auth.isAuthenticated,
|
|
|
+ isLoading: state.spinner.isVisible,
|
|
|
notification: state.notification
|
|
|
}
|
|
|
}
|