Class: Carnival::SessionsController
- Inherits:
-
Devise::SessionsController
- Object
- Devise::SessionsController
- Carnival::SessionsController
- Defined in:
- app/controllers/carnival/sessions_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
4 5 6 7 8 |
# File 'app/controllers/carnival/sessions_controller.rb', line 4 def create resource = warden.authenticate!(:scope => resource_name, :recall => "#{controller_path}#new") (:success, :signed_in) if redirect_to admin_root_url end |
#destroy ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'app/controllers/carnival/sessions_controller.rb', line 10 def destroy redirect_path = after_sign_out_path_for(resource_name) signed_out = (Devise.sign_out_all_scopes ? sign_out : sign_out(resource_name)) :success, :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 |