Class: Kingsman::SessionsController
- Inherits:
-
KingsmanController
- Object
- KingsmanController
- Kingsman::SessionsController
- Defined in:
- app/controllers/kingsman/sessions_controller.rb
Instance Method Summary collapse
-
#create {|resource| ... } ⇒ Object
POST /resource/sign_in.
-
#destroy ⇒ Object
DELETE /resource/sign_out.
-
#new {|resource| ... } ⇒ Object
GET /resource/sign_in.
Methods inherited from KingsmanController
Instance Method Details
#create {|resource| ... } ⇒ Object
POST /resource/sign_in
16 17 18 19 20 21 22 |
# File 'app/controllers/kingsman/sessions_controller.rb', line 16 def create self.resource = warden.authenticate!() (:notice, :signed_in) sign_in(resource_name, resource) yield resource if block_given? respond_with resource, location: after_sign_in_path_for(resource) end |
#destroy ⇒ Object
DELETE /resource/sign_out
25 26 27 28 29 30 |
# File 'app/controllers/kingsman/sessions_controller.rb', line 25 def destroy signed_out = (Kingsman.sign_out_all_scopes ? sign_out : sign_out(resource_name)) :notice, :signed_out if signed_out yield if block_given? respond_to_on_destroy end |
#new {|resource| ... } ⇒ Object
GET /resource/sign_in
8 9 10 11 12 13 |
# File 'app/controllers/kingsman/sessions_controller.rb', line 8 def new self.resource = resource_class.new(sign_in_params) clean_up_passwords(resource) yield resource if block_given? respond_with(resource, (resource)) end |