aboutsummaryrefslogtreecommitdiff
path: root/src/screens/onboarding/Verification.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/screens/onboarding/Verification.tsx')
-rw-r--r--src/screens/onboarding/Verification.tsx18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/screens/onboarding/Verification.tsx b/src/screens/onboarding/Verification.tsx
index 77a43a6d..baa5c6b3 100644
--- a/src/screens/onboarding/Verification.tsx
+++ b/src/screens/onboarding/Verification.tsx
@@ -42,9 +42,7 @@ const Verification: React.FC<VerificationProps> = ({route, navigation}) => {
value,
setValue,
});
- const registrationVals = route.params;
- const username: string = registrationVals!.username;
- const email: string = registrationVals!.email;
+ const {username, email, userId} = route.params;
/**
* Sends the verify_otp request upon tapping the Verify button.
@@ -61,7 +59,10 @@ const Verification: React.FC<VerificationProps> = ({route, navigation}) => {
});
let statusCode = verifyOtpResponse.status;
if (statusCode === 200) {
- navigation.navigate('Profile');
+ navigation.navigate('Profile', {
+ userId: userId,
+ username: username,
+ });
} else {
Alert.alert(
'Invalid verification code 🤔',
@@ -69,7 +70,14 @@ const Verification: React.FC<VerificationProps> = ({route, navigation}) => {
);
}
} catch (error) {
- console.log(error);
+ Alert.alert(
+ 'Verifiation failed 😓',
+ 'Please double-check your network connection and retry.',
+ );
+ return {
+ name: 'Verification error',
+ description: error,
+ };
}
};