Sha256: c081329940144556fd8e89d74ce2566a1a4a007702725bc5983960095805231a

Contents?: true

Size: 804 Bytes

Versions: 37

Compression:

Stored size: 804 Bytes

Contents

module PushType
  class ConfirmationsController < Devise::ConfirmationsController
    layout 'push_type/auth'

    def show
      self.resource = resource_class.find_by_confirmation_token params[:confirmation_token]
      super if resource.nil? or resource.confirmed?
    end

    def update
      self.resource = resource_class.find_by_confirmation_token! user_params[:confirmation_token]
      resource.assign_attributes(user_params)

      if resource.valid?
        self.resource.confirm
        set_flash_message :notice, :confirmed
        sign_in_and_redirect resource_name, resource
      else
        render action: 'show'
      end
    end

    private

    def user_params
      params.fetch(resource_name, {}).permit(:confirmation_token, :password, :password_confirmation)
    end

  end
end

Version data entries

37 entries across 37 versions & 1 rubygems

Version Path
push_type_auth-0.9.0.beta.3 app/controllers/push_type/confirmations_controller.rb
push_type_auth-0.9.0.beta.2 app/controllers/push_type/confirmations_controller.rb
push_type_auth-0.8.2 app/controllers/push_type/confirmations_controller.rb
push_type_auth-0.8.1 app/controllers/push_type/confirmations_controller.rb
push_type_auth-0.8.0 app/controllers/push_type/confirmations_controller.rb
push_type_auth-0.8.0.beta.3 app/controllers/push_type/confirmations_controller.rb
push_type_auth-0.8.0.beta.2 app/controllers/push_type/confirmations_controller.rb
push_type_auth-0.8.0.beta.1 app/controllers/push_type/confirmations_controller.rb
push_type_auth-0.7.0 app/controllers/push_type/confirmations_controller.rb
push_type_auth-0.7.0.beta.1 app/controllers/push_type/confirmations_controller.rb
push_type_auth-0.6.0 app/controllers/push_type/confirmations_controller.rb
push_type_auth-0.6.0.beta.4 app/controllers/push_type/confirmations_controller.rb
push_type_auth-0.6.0.beta.3 app/controllers/push_type/confirmations_controller.rb
push_type_auth-0.6.0.beta.2 app/controllers/push_type/confirmations_controller.rb
push_type_auth-0.6.0.beta.1 app/controllers/push_type/confirmations_controller.rb
push_type_auth-0.5.3 app/controllers/push_type/confirmations_controller.rb
push_type_auth-0.5.2 app/controllers/push_type/confirmations_controller.rb