LoginPage: fix crash
This commit is contained in:
parent
76dff42c7d
commit
0ceed56f99
1 changed files with 3 additions and 2 deletions
|
@ -52,8 +52,9 @@ class LoginPage extends ImmutablePureComponent {
|
|||
dispatch(switchAccount(account.id));
|
||||
}
|
||||
}).catch(error => {
|
||||
if (error.response.data.error === 'mfa_required') {
|
||||
this.setState({ mfa_auth_needed: true, mfa_token: error.response.data.mfa_token });
|
||||
const data = error.response && error.response.data;
|
||||
if (data && data.error === 'mfa_required') {
|
||||
this.setState({ mfa_auth_needed: true, mfa_token: data.mfa_token });
|
||||
}
|
||||
this.setState({ isLoading: false });
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue