Register
Description#
This function will allow users to register to the system as a clients and send them an OTP for logging in.
Input#
Phone number#
- Validation
Additional validation#
- The phone number must not belong to any other client with Entity propertyverified as Valuetrue.
Access#
Any non-authenticated user can access this function.
Mechanism#
- Create the client user with the provided phone number.
- Generate & save the following Entity propertyOTP:
- Entity propertyToken - A random 4 digit number
- Entity propertyExpiration date - 2 minutes from the moment of creation
- Entity propertyFailed login attempts - defaults to 0
- Send the OTP to the provided phone number via Twilio.