Skip to content

Commit

Permalink
Uppercase the auth factor token in input value to match the email cas…
Browse files Browse the repository at this point in the history
…ing. (#7094)
  • Loading branch information
BradEstey authored Dec 13, 2024
1 parent add7a91 commit 5655241
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/screens/Login/LoginForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ export const LoginForm = ({
const [isProcessing, setIsProcessing] = useState<boolean>(false)
const [isAuthFactorTokenNeeded, setIsAuthFactorTokenNeeded] =
useState<boolean>(false)
const [isAuthFactorTokenValueEmpty, setIsAuthFactorTokenValueEmpty] =
useState<boolean>(true)
const identifierValueRef = useRef<string>(initialHandle || '')
const passwordValueRef = useRef<string>('')
const authFactorTokenValueRef = useRef<string>('')
Expand Down Expand Up @@ -262,13 +264,21 @@ export const LoginForm = ({
textContentType="username"
blurOnSubmit={false} // prevents flickering due to onSubmitEditing going to next field
onChangeText={v => {
setIsAuthFactorTokenValueEmpty(v === '')
authFactorTokenValueRef.current = v
}}
onSubmitEditing={onPressNext}
editable={!isProcessing}
accessibilityHint={_(
msg`Input the code which has been emailed to you`,
)}
style={[
{
textTransform: isAuthFactorTokenValueEmpty
? 'none'
: 'uppercase',
},
]}
/>
</TextField.Root>
<Text style={[a.text_sm, t.atoms.text_contrast_medium, a.mt_sm]}>
Expand Down

0 comments on commit 5655241

Please sign in to comment.