Skip to content

Commit e74a6bd

Browse files
chore: Add autocomplete attribute to 2FA input fields (RocketChat#37014)
Co-authored-by: Douglas Fabris <devfabris@gmail.com>
1 parent c544b80 commit e74a6bd

2 files changed

Lines changed: 18 additions & 2 deletions

File tree

apps/meteor/client/components/TwoFactorModal/TwoFactorEmailModal.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,15 @@ const TwoFactorEmailModal = ({ onConfirm, onClose, emailOrUsername, invalidAttem
6565
{t('Enter_the_code_we_just_emailed_you')}
6666
</FieldLabel>
6767
<FieldRow>
68-
<TextInput id={id} ref={ref} value={code} onChange={onChange} placeholder={t('Enter_code_here')} />
68+
<TextInput
69+
id={id}
70+
ref={ref}
71+
value={code}
72+
onChange={onChange}
73+
placeholder={t('Enter_code_here')}
74+
autoComplete='one-time-code'
75+
inputMode='numeric'
76+
/>
6977
</FieldRow>
7078
{invalidAttempt && <FieldError>{t('Invalid_password')}</FieldError>}
7179
</Field>

apps/meteor/client/components/TwoFactorModal/TwoFactorTotpModal.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,15 @@ const TwoFactorTotpModal = ({ onConfirm, onClose, onDismiss, invalidAttempt }: T
4949
{t('Enter_the_code_provided_by_your_authentication_app_to_continue')}
5050
</FieldLabel>
5151
<FieldRow>
52-
<TextInput id={id} ref={ref} value={code} onChange={onChange} placeholder={t('Enter_code_here')}></TextInput>
52+
<TextInput
53+
id={id}
54+
ref={ref}
55+
value={code}
56+
onChange={onChange}
57+
placeholder={t('Enter_code_here')}
58+
autoComplete='one-time-code'
59+
inputMode='numeric'
60+
/>
5361
</FieldRow>
5462
{invalidAttempt && <FieldError>{t('Invalid_password')}</FieldError>}
5563
</Field>

0 commit comments

Comments
 (0)