Fix login
login().then(...) executes too early, we need to wait for SUCCESS. Change-Id: I1b5b278dad7737a5369d1b6903d3e03c09e095a3
This commit is contained in:
parent
a6d5558d94
commit
00c59c9575
@ -38,11 +38,8 @@ export class Login extends Component {
|
|||||||
this.setState({ submitted: true });
|
this.setState({ submitted: true });
|
||||||
const { homeserver, username, password } = this.state;
|
const { homeserver, username, password } = this.state;
|
||||||
const { login } = this.props.actions;
|
const { login } = this.props.actions;
|
||||||
const { history } = this.props;
|
|
||||||
if (homeserver && username && password) {
|
if (homeserver && username && password) {
|
||||||
login(homeserver, username, password).then(
|
login(homeserver, username, password);
|
||||||
history.push("/user-admin/list")
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -52,7 +49,7 @@ export class Login extends Component {
|
|||||||
const { homeserver, username, password, submitted } = this.state;
|
const { homeserver, username, password, submitted } = this.state;
|
||||||
return (
|
return (
|
||||||
<div className="home-login">
|
<div className="home-login">
|
||||||
{mtx && mtx.clientRunning &&
|
{mtx && mtx.clientRunning && mtx.credentials.userId && !loginPending &&
|
||||||
<Redirect to="/user-admin/list" />
|
<Redirect to="/user-admin/list" />
|
||||||
}
|
}
|
||||||
<header className="app-header">
|
<header className="app-header">
|
||||||
|
Loading…
Reference in New Issue
Block a user