Sha256: 49b2986b46ea3c44cdb23f3be632690443b400085de8df34a1fe623c7f8f0a0a

Contents?: true

Size: 1.13 KB

Versions: 10

Compression:

Stored size: 1.13 KB

Contents

class Devise::PhoneVerificationsController < DeviseController

  # GET /resource/phone_verification/new
  def new
    build_resource({})
    render :new
  end

  # POST /resource/phone_verification
  def create

    self.send_verification_code

    # self.resource = resource_class.send_verification_code
    
    # if resource.errors.empty?
    #   set_flash_message :notice, :send_token, :phone => self.resource.phone
    #   redirect_to new_session_path(resource_name)
    # else
    #   render :new
    # end
  end
  
  # GET /resource/phone_verification/insert
  def insert
    build_resource({})
  end
  
  # GET or POST /resource/phone_verification/consume?sms_token=abcdef
  def consume
    
    self.verify_phone_number_with_code_entered(params[:code_entered])

    # self.resource = resource_class.verify_phone_number_with_code_entered(params[:code_entered])

    # if resource.errors.empty?
    #   set_flash_message :notice, :confirmed
    #   sign_in_and_redirect(resource_name, resource)
    # else
    #   render :new
    # end

  end
  
  protected
  
    def build_resource(hash = nil)
      self.resource = resource_class.new
    end

end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
devise_phone-0.0.164 app/controllers/devise/phone_verifications_controller.rb
devise_phone-0.0.162 app/controllers/devise/phone_verifications_controller.rb
devise_phone-0.0.161 app/controllers/devise/phone_verifications_controller.rb
devise_phone-0.0.16 app/controllers/devise/phone_verifications_controller.rb
devise_phone-0.0.15 app/controllers/devise/phone_verifications_controller.rb
devise_phone-0.0.14 app/controllers/devise/phone_verifications_controller.rb
devise_phone-0.0.13 app/controllers/devise/phone_verifications_controller.rb
devise_phone-0.0.12 app/controllers/devise/phone_verifications_controller.rb
devise_phone-0.0.11 app/controllers/devise/phone_verifications_controller.rb
devise_phone-0.0.1 app/controllers/devise/phone_verifications_controller.rb