From c1cfd2ca2a242e5723fed36891cceee71470e46c Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Wed, 12 Jan 2022 10:52:28 -0600 Subject: [PATCH] MFA login: be less sensitive about the error response --- .../features/auth_login/components/otp_auth_form.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) 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 && (
- } + )}