kopia lustrzana https://gitlab.com/soapbox-pub/soapbox
MFA login: be less sensitive about the error response
rodzic
9f08e63372
commit
c1cfd2ca2a
|
@ -45,10 +45,7 @@ class OtpAuthForm extends ImmutablePureComponent {
|
||||||
this.setState({ shouldRedirect: true });
|
this.setState({ shouldRedirect: true });
|
||||||
return dispatch(switchAccount(account.id));
|
return dispatch(switchAccount(account.id));
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
this.setState({ isLoading: false });
|
this.setState({ isLoading: false, code_error: true });
|
||||||
if (error.response.data.error === 'Invalid code') {
|
|
||||||
this.setState({ code_error: true });
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
this.setState({ isLoading: true });
|
this.setState({ isLoading: true });
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
@ -82,11 +79,11 @@ class OtpAuthForm extends ImmutablePureComponent {
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
{ code_error &&
|
{code_error && (
|
||||||
<div className='error-box'>
|
<div className='error-box'>
|
||||||
<FormattedMessage id='login.otp_log_in.fail' defaultMessage='Invalid code, please try again.' />
|
<FormattedMessage id='login.otp_log_in.fail' defaultMessage='Invalid code, please try again.' />
|
||||||
</div>
|
</div>
|
||||||
}
|
)}
|
||||||
<div className='actions'>
|
<div className='actions'>
|
||||||
<button name='button' type='submit' className='btn button button-primary'>
|
<button name='button' type='submit' className='btn button button-primary'>
|
||||||
<FormattedMessage id='login.log_in' defaultMessage='Log in' />
|
<FormattedMessage id='login.log_in' defaultMessage='Log in' />
|
||||||
|
|
Ładowanie…
Reference in New Issue