Class: Devise::RevocationsController

Inherits:
ApplicationController
  • Object
show all
Includes:
Controllers::InternalHelpers
Defined in:
app/controllers/devise/revocations_controller.rb

Instance Method Summary collapse

Instance Method Details

#editObject

GET /resource/revocation/confirm?revocation_token=abcdef



5
6
7
8
9
10
11
# File 'app/controllers/devise/revocations_controller.rb', line 5

def edit
  if params[:revocation_token] && self.resource = resource_class.find_by_revocation_token(params[:revocation_token])
    render_with_scope :edit
  else
    set_error_and_redirect
  end
end

#updateObject

PUT /resource/revocation



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

def update
  token = params[resource_name].try(:[], :revocation_token)

  self.resource = resource_class.revoke_by_token(token)

  if resource.errors.empty?
    set_flash_message :notice, :updated
    sign_out(self.resource)
    render_with_scope :edit
  else
    set_error_and_redirect
  end
end