Skip to content

Instantly share code, notes, and snippets.

@daydream05
Created January 12, 2018 00:00
Show Gist options
  • Select an option

  • Save daydream05/3c9558ebf89db2a3f24706c5071ad19a to your computer and use it in GitHub Desktop.

Select an option

Save daydream05/3c9558ebf89db2a3f24706c5071ad19a to your computer and use it in GitHub Desktop.

Revisions

  1. daydream05 created this gist Jan 12, 2018.
    12 changes: 12 additions & 0 deletions phone_verifications_start_controller.rb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    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