aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/constants/regex.ts4
-rw-r--r--src/screens/onboarding/RegistrationOne.tsx4
-rw-r--r--src/services/UserProfileService.ts12
3 files changed, 4 insertions, 16 deletions
diff --git a/src/constants/regex.ts b/src/constants/regex.ts
index fe5ce3ab..7de36492 100644
--- a/src/constants/regex.ts
+++ b/src/constants/regex.ts
@@ -52,10 +52,10 @@ export const genderRegex: RegExp = /^$|^[A-Za-z\- ]{2,20}$/;
/**
* The phone regex has the following constraints
* - must be 10 digits
- * - accepts 012-345-6789
+ * - accepts 0123456789
*
*/
-export const phoneRegex: RegExp = /([0-9]{10})/;
+export const phoneRegex: RegExp = /^[0-9]{10}$/;
/**
* The code regex has the following constraints
diff --git a/src/screens/onboarding/RegistrationOne.tsx b/src/screens/onboarding/RegistrationOne.tsx
index 2a1d884d..c9822f76 100644
--- a/src/screens/onboarding/RegistrationOne.tsx
+++ b/src/screens/onboarding/RegistrationOne.tsx
@@ -146,7 +146,7 @@ const RegistrationOne: React.FC<RegistrationOneProps> = ({navigation}) => {
<Text style={styles.formHeader}>ENTER PHONE NUMBER</Text>
</View>
<TaggInput
- maxLength={12} // currently only support US phone numbers
+ maxLength={10} // currently only support US phone numbers
accessibilityHint="Enter your phone number."
accessibilityLabel="Phone number input field."
placeholder="Phone Number"
@@ -154,7 +154,7 @@ const RegistrationOne: React.FC<RegistrationOneProps> = ({navigation}) => {
textContentType="telephoneNumber"
autoCapitalize="none"
returnKeyType="next"
- keyboardType="phone-pad"
+ keyboardType="number-pad"
onChangeText={handlePhoneUpdate}
blurOnSubmit={false}
ref={phoneRef}
diff --git a/src/services/UserProfileService.ts b/src/services/UserProfileService.ts
index 75d7d367..b400843d 100644
--- a/src/services/UserProfileService.ts
+++ b/src/services/UserProfileService.ts
@@ -164,12 +164,8 @@ export const loadRecentlySearchedUsers = async () => {
export const handlePasswordResetRequest = async (value: string) => {
try {
- const token = await AsyncStorage.getItem('token');
const response = await fetch(PASSWORD_RESET_ENDPOINT + 'request/', {
method: 'POST',
- headers: {
- Authorization: 'Token ' + token,
- },
body: JSON.stringify({
value,
}),
@@ -204,12 +200,8 @@ export const handlePasswordCodeVerification = async (
otp: string,
) => {
try {
- const token = await AsyncStorage.getItem('token');
const response = await fetch(PASSWORD_RESET_ENDPOINT + 'verify/', {
method: 'POST',
- headers: {
- Authorization: 'Token ' + token,
- },
body: JSON.stringify({
value,
otp,
@@ -239,12 +231,8 @@ export const handlePasswordCodeVerification = async (
export const handlePasswordReset = async (value: string, password: string) => {
try {
- const token = await AsyncStorage.getItem('token');
const response = await fetch(PASSWORD_RESET_ENDPOINT + 'reset/', {
method: 'POST',
- headers: {
- Authorization: 'Token ' + token,
- },
body: JSON.stringify({
value,
password,