Class: SessionsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- SessionsController
- Includes:
- Devise::Controllers::InternalHelpers
- Defined in:
- app/controllers/sessions_controller.rb
Instance Method Summary collapse
-
#create ⇒ Object
POST /resource/sign_in.
-
#destroy ⇒ Object
GET /resource/sign_out.
-
#new ⇒ Object
GET /resource/sign_in.
Methods included from Devise::Controllers::InternalHelpers
#devise_controller?, #devise_mapping, included, #resource, #resource_class, #resource_name
Instance Method Details
#create ⇒ Object
POST /resource/sign_in
18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'app/controllers/sessions_controller.rb', line 18 def create if resource = authenticate(resource_name) if !performed? :notice, :signed_in sign_in_and_redirect(resource_name, resource, true) end elsif [:custom, :redirect].include?(warden.result) throw :warden, :scope => resource_name elsif !performed? :alert, (warden. || :invalid) clean_up_passwords(build_resource) render_with_scope :new unless performed? end end |
#destroy ⇒ Object
GET /resource/sign_out
34 35 36 37 |
# File 'app/controllers/sessions_controller.rb', line 34 def destroy :notice, :signed_out if signed_in?(resource_name) sign_out_and_redirect(resource_name) end |
#new ⇒ Object
GET /resource/sign_in
6 7 8 9 10 11 12 13 14 15 |
# File 'app/controllers/sessions_controller.rb', line 6 def new unless flash[:notice].present? Devise::FLASH_MESSAGES.each do || :alert, if params.try(:[], ) == "true" end end build_resource render_with_scope :new end |