Skip to content

SMS OTP Integration Draft#4

Open
1jeanpaul1 wants to merge 1 commit intofcgl:masterfrom
1jeanpaul1:smsIntegration
Open

SMS OTP Integration Draft#4
1jeanpaul1 wants to merge 1 commit intofcgl:masterfrom
1jeanpaul1:smsIntegration

Conversation

@1jeanpaul1
Copy link
Contributor

@1jeanpaul1 1jeanpaul1 commented Nov 20, 2019

Problem

We should have the ability to sign up with your phone number

Solution

  1. Create a Twilio account for SMS messages
  2. Integrate phone number into current service
  3. Implement a basic OTP generator for testing

Testing

  1. Create a Twilio account with my referral code: www.twilio.com/referral/Bh2DiA
  2. Copy your ACCOUNT_SID and AUTH_TOKEN and paste it into /TwilioSms
  3. Build and Run the application docker-compose up --build
    • Open README. Need to install docker and docker-compose
  4. Make a POST request to sign up
    • URL: http://localhost:8080/auth/signup
    • BODY: {"name": "<ANY NAME>","phoneNumber": "<PHONE NUMBER WITH AREA CODE>"}
    • You should get a successful response and an SMS to the phone number you put down in a few seconds
  5. Make a POST request to log in
    • URL: http://localhost:8080/auth/login
    • BODY: {"password": "<THE OTP YOU RECEIVED>","phoneNumber": "<THE PHONE NUMBER YOU SIGNED UP WITH>"}
    • You should get a JWT token from this request if successful

TODO:

  • Need to do a phone number validation and add error handling to Twilio API
  • Need to create a stronger OTP generator
  • Need to make sending of SMS asynchronous

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant