- Authenticate your Rails API with Twilio
[email protected]:Njunu-sk/OTP-Authentication-in-Rails-API..git
bundle install
- Run spec files
bundle exec rspec
REDIS_URL=redis://127.0.0.1:XXXX/0
AUTH_TOKEN=XXXXXXXXXXXXXXXXXXXXXXXX
SERVICE_SID=XXXXXXXXXXXXXXXXXXXXXXXX
ACCOUNT_SID=XXXXXXXXXXXXXXXXXXXXXXXX
-
Get service id from
Verify Service
Twilio -
Make sure you have
sidekiq
installed. -
Start sidekiq and rails server
bundle exec sidekiq
rails s
-
Make sure you have
postman
installed -
Visit
localhost:3000/send_otp_code
, this is aPOST
request, we are prompting Twilio to send us an otp.
- Check the logs
-
Replace phonenumber and country code.
-
You will receive a
valid code
in your mobile.
- Visit
localhost:3000/user
, this is aPOST
request.
- Check logs
- You have Authenticated a User with OTP.