From 00c59c957530ca6af13f10f523ff0c4de23c94b7 Mon Sep 17 00:00:00 2001 From: Manuel Stahl Date: Fri, 26 Jul 2019 21:28:44 +0200 Subject: [PATCH] Fix login login().then(...) executes too early, we need to wait for SUCCESS. Change-Id: I1b5b278dad7737a5369d1b6903d3e03c09e095a3 --- src/features/home/Login.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/features/home/Login.js b/src/features/home/Login.js index a491870..393adff 100644 --- a/src/features/home/Login.js +++ b/src/features/home/Login.js @@ -38,11 +38,8 @@ export class Login extends Component { this.setState({ submitted: true }); const { homeserver, username, password } = this.state; const { login } = this.props.actions; - const { history } = this.props; if (homeserver && username && password) { - login(homeserver, username, password).then( - history.push("/user-admin/list") - ); + login(homeserver, username, password); } } @@ -52,7 +49,7 @@ export class Login extends Component { const { homeserver, username, password, submitted } = this.state; return (
- {mtx && mtx.clientRunning && + {mtx && mtx.clientRunning && mtx.credentials.userId && !loginPending && }