All form validation uses react-hook-form with Zod schema resolvers. OTP inputs use a dedicated
OTPInput component that enforces a maximum length of 4 digits.Registration flow
Enter email address
Screen: On submit, a POST request is sent to send an OTP to the provided email:A successful response returns the user object including
EmailInput (src/screens/Authentication/EmailVerify/EmailInput.jsx)The user enters their email address. The field is validated with the following Zod schema before the API call is made:EmailInput.jsx
Request body
email, uuid, and verification_code. The app navigates to EMAIL_VERIFY, passing email, uuid, and verification_code as route params.Verify email OTP
Screen: On success, the app navigates to
EmailVerify (src/screens/Authentication/EmailVerify/EmailVerify.jsx)The user enters the 4-digit OTP sent to their email. The code is valid for 5 minutes.Request body
EMAIL_VERIFY_SUCCESS, adding email_verify_at (timestamp) to the route params.Email verified
Screen:
EmailVerifySuccess (src/screens/Authentication/EmailVerify/EmailVerifySuccess.jsx)Displays a success confirmation with the verification timestamp formatted as hh:mm A. The user taps Continue to proceed to phone number entry.The app navigates to NUMBER_INPUT, carrying all previous route params forward.Enter phone number
Screen: On success, the app navigates to
NumberInput (src/screens/Authentication/NumberVerify/NumberInput.jsx)The user selects a country code from a picker (defaulting to +1868 / Trinidad and Tobago) and enters their phone number. The phone number field is prefilled with the dial code on focus.Request body
NUMBER_VERIFY, passing the entered phone in route params.Verify phone OTP
Screen: On success, the app navigates to
NumberVerify (src/screens/Authentication/NumberVerify/NumberVerify.jsx)The user enters the 4-digit OTP sent to their phone. The code is valid for 5 minutes.Request body
NUMBER_VERIFY_SUCCESS, adding phone_verify_at to the route params.Phone verified
Screen:
NumberVerifySuccess (src/screens/Authentication/NumberVerify/NumberVerifySuccess.jsx)Displays a success confirmation with the phone verification timestamp. The user taps Continue to proceed.The app navigates to EMAIL_NUMBER_VERIFY_SUCCESS.Both verifications complete
Screen:
EmailNumberVerifySuccess (src/screens/Authentication/Success/EmailNumberVerifySuccess.jsx)An info screen confirming that both email and phone have been verified. The user taps Start KYC to proceed to PIN creation.The app navigates to CREATE_PIN_INPUT.Create PIN
Screen: On success, the app navigates to
CreatePinInput (src/screens/Authentication/CreatePin/CreatePinInput.jsx)The user sets their personal 4-digit PIN. This PIN is used for all future logins and payment confirmations.Request body
CONFIRM_PIN, passing the entered pin in route params.Confirm PIN
Screen: The response includes the JWT
ConfirmPin (src/screens/Authentication/CreatePin/ConfirmPin.jsx)The user re-enters their PIN to confirm it. On success:Request body
token and user object. The token is written to AsyncStorage under the key token, and the user object is stored in useAuthStore via setUser.The app navigates to CREATE_PIN_SUCCESS.Registration complete
Screen:
CreatePinSuccess (src/screens/Authentication/CreatePin/CreatePinSuccess.jsx)Displays “Pin Set Successfully!” with the timestamp. The user taps Done.setLoggedIn(true) is called, and the navigation stack is reset to MAIN_STACK, taking the user directly into the authenticated experience.Route parameter chain
Route params are threaded through the entire registration flow so that each screen has access to the data it needs:Validation rules summary
| Field | Rule | Error message |
|---|---|---|
email | Required, valid email format | Email field is required / Invalid email address |
verification_code (email) | Exactly 4 digits | Code length should be 4 |
phone | Numeric, prefixed with dial code | Client-side format enforcement |
verification_code (phone) | Exactly 4 digits | Code length should be 4 |
pin | Exactly 4 digits | Code length should be 4 |
confirm_pin | Exactly 4 digits | Code length should be 4 |