Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recovery code input fix #36774

Merged
merged 9 commits into from
Mar 13, 2024
2 changes: 0 additions & 2 deletions src/CONST.ts
Original file line number Diff line number Diff line change
Expand Up @@ -991,8 +991,6 @@ const CONST = {
MAGIC_CODE_LENGTH: 6,
MAGIC_CODE_EMPTY_CHAR: ' ',

RECOVERY_CODE_LENGTH: 8,

KEYBOARD_TYPE: {
VISIBLE_PASSWORD: 'visible-password',
ASCII_CAPABLE: 'ascii-capable',
Expand Down
4 changes: 2 additions & 2 deletions src/pages/signin/ValidateCodeForm/BaseValidateCodeForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ function BaseValidateCodeForm({account, credentials, session, autoComplete, isUs
setTwoFactorAuthCode(text);
}
if (key === 'recoveryCode') {
setRecoveryCode(text);
setRecoveryCode(text.trim());
}

setFormError((prevError) => ({...prevError, [key]: undefined}));
Expand Down Expand Up @@ -290,7 +290,7 @@ function BaseValidateCodeForm({account, credentials, session, autoComplete, isUs
accessibilityLabel={translate('recoveryCodeForm.recoveryCode')}
value={recoveryCode}
onChangeText={(text) => onTextInput(text, 'recoveryCode')}
maxLength={CONST.RECOVERY_CODE_LENGTH}
maxLength={CONST.FORM_CHARACTER_LIMIT}
label={translate('recoveryCodeForm.recoveryCode')}
errorText={formError?.recoveryCode ?? ''}
hasError={hasError}
Expand Down
Loading