Class: Devise::ParanoidVerificationCodeController

Inherits:
DeviseController
  • Object
show all
Defined in:
app/controllers/devise/paranoid_verification_code_controller.rb

Instance Method Summary collapse

Instance Method Details

#showObject



7
8
9
10
11
12
13
# File 'app/controllers/devise/paranoid_verification_code_controller.rb', line 7

def show
  if !resource.nil? && resource.need_paranoid_verification?
    respond_with(resource)
  else
    redirect_to :root
  end
end

#updateObject



15
16
17
18
19
20
21
22
23
24
# File 'app/controllers/devise/paranoid_verification_code_controller.rb', line 15

def update
  if resource.verify_code(resource_params[:paranoid_verification_code])
    warden.session(scope)['paranoid_verify'] = false
    set_flash_message :notice, :updated
     resource, scope: scope
    redirect_to stored_location_for(scope) || :root
  else
    respond_with(resource, action: :show)
  end
end