Skip to content

Instantly share code, notes, and snippets.

@daydream05
Created January 12, 2018 00:00
Show Gist options
  • Save daydream05/3c9558ebf89db2a3f24706c5071ad19a to your computer and use it in GitHub Desktop.
Save daydream05/3c9558ebf89db2a3f24706c5071ad19a to your computer and use it in GitHub Desktop.
don't use for production
class Api::V1::PhoneVerificationsController < ApplicationController
def start
response = Authy::PhoneVerification.start(via: "sms", country_code: 1, phone_number: phone_number_params)
if response.ok?
# verification was started
render json: {"success": true, message: "Verification code was sent to your phone number"}, status: :ok
else
render json: response
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment