Class: Ninsho::SessionsController
- Inherits:
-
NinshoController
- Object
- NinshoController
- Ninsho::SessionsController
- Defined in:
- app/controllers/ninsho/sessions_controller.rb
Instance Method Summary collapse
-
#create ⇒ Object
Handles the omniauth record creation.
- #destroy ⇒ Object
- #new ⇒ Object
Methods inherited from NinshoController
#build_resource_from_omniauth, #flash_message, #parent_resource, #resource, #resource=, #resource_class, #resource_name, #resource_params
Instance Method Details
#create ⇒ Object
Handles the omniauth record creation
8 9 10 11 12 13 14 15 16 17 |
# File 'app/controllers/ninsho/sessions_controller.rb', line 8 def create resource = build_resource_from_omniauth if resource.authenticated? sign_in resource.send(Ninsho.parent_resource_name.to_s.downcase).id (:notice, :signed_in) redirect_on_sign_in_path else redirect_to_root end end |
#destroy ⇒ Object
19 20 21 22 23 |
# File 'app/controllers/ninsho/sessions_controller.rb', line 19 def destroy sign_out (:notice, :signed_out) redirect_on_sign_out_path end |
#new ⇒ Object
3 4 5 |
# File 'app/controllers/ninsho/sessions_controller.rb', line 3 def new @providers = Ninsho.providers end |