about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorBrad Estey <BradEstey@users.noreply.github.com>2024-12-13 12:14:31 -0500
committerGitHub <noreply@github.com>2024-12-13 17:14:31 +0000
commit5655241bef22264ad9da3d9ba2074af4e9ba7dd0 (patch)
treeb6f08f07d2b07515a2c067e0583548ef7abec11f /src
parentadd7a91d54d24eb1f02c5a83c36db90834d94add (diff)
downloadvoidsky-5655241bef22264ad9da3d9ba2074af4e9ba7dd0.tar.zst
Uppercase the auth factor token in input value to match the email casing. (#7094)
Diffstat (limited to 'src')
-rw-r--r--src/screens/Login/LoginForm.tsx10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/screens/Login/LoginForm.tsx b/src/screens/Login/LoginForm.tsx
index 6a48b1bcc..2cd6abdd1 100644
--- a/src/screens/Login/LoginForm.tsx
+++ b/src/screens/Login/LoginForm.tsx
@@ -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>('')
@@ -262,6 +264,7 @@ 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}
@@ -269,6 +272,13 @@ export const LoginForm = ({
               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]}>