Class: Devise::SessionsController

Inherits:
DeviseController show all
Defined in:
app/controllers/devise/sessions_controller.rb

Instance Method Summary collapse

Methods inherited from DeviseController

#_prefixes, internal_methods

Instance Method Details

#create {|resource| ... } ⇒ Object

POST /resource/sign_in

Yields:

  • (resource)


18
19
20
21
22
23
24
# File 'app/controllers/devise/sessions_controller.rb', line 18

def create
  self.resource = warden.authenticate!(auth_options)
  set_flash_message!(:notice, :signed_in)
  (resource_name, resource)
  yield resource if block_given?
  respond_with resource, location: (resource)
end

#destroyObject

DELETE /resource/sign_out



27
28
29
30
31
32
# File 'app/controllers/devise/sessions_controller.rb', line 27

def destroy
  signed_out = (Devise.sign_out_all_scopes ? sign_out : sign_out(resource_name))
  set_flash_message! :notice, :signed_out if signed_out
  yield if block_given?
  respond_to_on_destroy
end

#new {|resource| ... } ⇒ Object

GET /resource/sign_in

Yields:

  • (resource)


10
11
12
13
14
15
# File 'app/controllers/devise/sessions_controller.rb', line 10

def new
  self.resource = resource_class.new()
  clean_up_passwords(resource)
  yield resource if block_given?
  respond_with(resource, serialize_options(resource))
end