Skip to content

Commit 5655241

Browse files
authored
Uppercase the auth factor token in input value to match the email casing. (bluesky-social#7094)
1 parent add7a91 commit 5655241

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/screens/Login/LoginForm.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ export const LoginForm = ({
6060
const [isProcessing, setIsProcessing] = useState<boolean>(false)
6161
const [isAuthFactorTokenNeeded, setIsAuthFactorTokenNeeded] =
6262
useState<boolean>(false)
63+
const [isAuthFactorTokenValueEmpty, setIsAuthFactorTokenValueEmpty] =
64+
useState<boolean>(true)
6365
const identifierValueRef = useRef<string>(initialHandle || '')
6466
const passwordValueRef = useRef<string>('')
6567
const authFactorTokenValueRef = useRef<string>('')
@@ -262,13 +264,21 @@ export const LoginForm = ({
262264
textContentType="username"
263265
blurOnSubmit={false} // prevents flickering due to onSubmitEditing going to next field
264266
onChangeText={v => {
267+
setIsAuthFactorTokenValueEmpty(v === '')
265268
authFactorTokenValueRef.current = v
266269
}}
267270
onSubmitEditing={onPressNext}
268271
editable={!isProcessing}
269272
accessibilityHint={_(
270273
msg`Input the code which has been emailed to you`,
271274
)}
275+
style={[
276+
{
277+
textTransform: isAuthFactorTokenValueEmpty
278+
? 'none'
279+
: 'uppercase',
280+
},
281+
]}
272282
/>
273283
</TextField.Root>
274284
<Text style={[a.text_sm, t.atoms.text_contrast_medium, a.mt_sm]}>

0 commit comments

Comments
 (0)