From 28513fe0364497cf765b8875a34bf67a1a07df13 Mon Sep 17 00:00:00 2001 From: Aditya Pawar Date: Mon, 18 Mar 2024 17:58:12 -0700 Subject: [PATCH] Fix small bugs in sign up and create password --- src/app/auth/resetPassword/index.tsx | 11 +++++++---- src/app/auth/signup/index.tsx | 3 ++- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/app/auth/resetPassword/index.tsx b/src/app/auth/resetPassword/index.tsx index 2d469f10..024fcf06 100644 --- a/src/app/auth/resetPassword/index.tsx +++ b/src/app/auth/resetPassword/index.tsx @@ -1,17 +1,15 @@ -import { Link, router } from 'expo-router'; -import React, { useEffect, useRef, useState } from 'react'; +import { router } from 'expo-router'; +import { useEffect, useState } from 'react'; import { Alert, Text, View } from 'react-native'; import { Icon as RNEIcon } from 'react-native-elements'; import styles from './styles'; -import Icon from '../../../../assets/icons'; import StyledButton from '../../../components/StyledButton/StyledButton'; import UserStringInput from '../../../components/UserStringInput/UserStringInput'; import colors from '../../../styles/colors'; import globalStyles from '../../../styles/globalStyles'; import { useSession } from '../../../utils/AuthContext'; import PasswordComplexityText from '../../../components/PasswordComplexityText/PasswordComplexityText'; -import supabase from '../../../utils/supabase'; function ResetPasswordScreen() { const { updateUser, signOut } = useSession(); @@ -43,6 +41,11 @@ function ResetPasswordScreen() { setHasNumber(/[0-9]/.test(text)); setHasLength(text.length >= 8); //need to check that it is different from old password + } else { + setHasUppercase(false); + setHasLowercase(false); + setHasNumber(false); + setHasLength(false); } }; diff --git a/src/app/auth/signup/index.tsx b/src/app/auth/signup/index.tsx index 5285ed9a..f7c9506f 100644 --- a/src/app/auth/signup/index.tsx +++ b/src/app/auth/signup/index.tsx @@ -7,7 +7,6 @@ import { SafeAreaView } from 'react-native-safe-area-context'; import validator from 'validator'; import styles from './styles'; -import Icon from '../../../../assets/icons'; import StyledButton from '../../../components/StyledButton/StyledButton'; import UserStringInput from '../../../components/UserStringInput/UserStringInput'; import PasswordComplexityText from '../../../components/PasswordComplexityText/PasswordComplexityText'; @@ -255,6 +254,8 @@ function SignUpScreen() { loading || emailError !== '' || usernameError !== '' || + firstName.length === 0 || + lastName.length === 0 || email.length === 0 || username.length === 0 }