Class: Devise::SessionsController

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

Instance Method Summary collapse

Methods included from Controllers::InternalHelpers

#devise_controller?, #devise_mapping, #resource, #resource_class, #resource_name

Instance Method Details

#createObject

POST /resource/sign_in



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

def create
  resource = warden.authenticate!(:scope => resource_name, :recall => "new")
  set_flash_message :notice, :signed_in
  (resource_name, resource)
end

#destroyObject

GET /resource/sign_out



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

def destroy
  set_flash_message :notice, :signed_out if signed_in?(resource_name)
  sign_out_and_redirect(resource_name)
end

#newObject

GET /resource/sign_in



6
7
8
9
# File 'app/controllers/devise/sessions_controller.rb', line 6

def new
  clean_up_passwords(build_resource)
  render_with_scope :new
end