Class: Devise::SessionsController
- Inherits:
-
DeviseController
- Object
- DeviseController
- Devise::SessionsController
- Defined in:
- app/controllers/devise/sessions_controller.rb
Instance Method Summary collapse
-
#create ⇒ Object
POST /resource/sign_in.
-
#destroy ⇒ Object
DELETE /resource/sign_out.
-
#new ⇒ Object
GET /resource/sign_in.
Methods inherited from DeviseController
#_prefixes, #devise_mapping, #resource, #resource_class, #resource_name, #resource_params, #signed_in_resource
Instance Method Details
#create ⇒ Object
POST /resource/sign_in
14 15 16 17 18 19 |
# File 'app/controllers/devise/sessions_controller.rb', line 14 def create self.resource = warden.authenticate!() (:notice, :signed_in) if sign_in(resource_name, resource) respond_with resource, :location => after_sign_in_path_for(resource) end |
#destroy ⇒ Object
DELETE /resource/sign_out
22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'app/controllers/devise/sessions_controller.rb', line 22 def destroy redirect_path = after_sign_out_path_for(resource_name) signed_out = (Devise.sign_out_all_scopes ? sign_out : sign_out(resource_name)) :notice, :signed_out if signed_out && # We actually need to hardcode this as Rails default responder doesn't # support returning empty response on GET request respond_to do |format| format.any(*) { redirect_to redirect_path } format.all do head :no_content end end end |
#new ⇒ Object
GET /resource/sign_in
7 8 9 10 11 |
# File 'app/controllers/devise/sessions_controller.rb', line 7 def new self.resource = build_resource(nil, :unsafe => true) clean_up_passwords(resource) respond_with(resource, (resource)) end |