LoginPage: fix crash

This commit is contained in:
Alex Gleason 2022-01-11 11:06:43 -06:00
parent 76dff42c7d
commit 0ceed56f99
No known key found for this signature in database
GPG key ID: 7211D1F99744FBB7

View file

@ -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 });
});