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#

  1. Create the client user with the provided phone number.
  2. Generate & save the following Entity propertyOTP:
    1. Entity propertyToken - A random 4 digit number
    2. Entity propertyExpiration date - 2 minutes from the moment of creation
    3. Entity propertyFailed login attempts - defaults to 0
  3. Send the OTP to the provided phone number via Twilio.