diff --git a/app/soapbox/features/auth_login/components/otp_auth_form.js b/app/soapbox/features/auth_login/components/otp_auth_form.js index 05d638bdc..9bd4afa6f 100644 --- a/app/soapbox/features/auth_login/components/otp_auth_form.js +++ b/app/soapbox/features/auth_login/components/otp_auth_form.js @@ -45,10 +45,7 @@ class OtpAuthForm extends ImmutablePureComponent { this.setState({ shouldRedirect: true }); return dispatch(switchAccount(account.id)); }).catch(error => { - this.setState({ isLoading: false }); - if (error.response.data.error === 'Invalid code') { - this.setState({ code_error: true }); - } + this.setState({ isLoading: false, code_error: true }); }); this.setState({ isLoading: true }); event.preventDefault(); @@ -82,11 +79,11 @@ class OtpAuthForm extends ImmutablePureComponent { - { code_error && + {code_error && (
- } + )}