Class: User::SignInsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- User::SignInsController
- Defined in:
- app/controllers/user/sign_ins_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
11 12 13 14 15 |
# File 'app/controllers/user/sign_ins_controller.rb', line 11 def create @sign_in = SignIn.new(sign_in_params).sign_in_with(Identities::Email) perform_sign_in @sign_in end |
#destroy ⇒ Object
30 31 32 33 |
# File 'app/controllers/user/sign_ins_controller.rb', line 30 def destroy session_manager.sign_out redirect_to root_url, notice: t('.success') end |
#new ⇒ Object
6 7 8 9 |
# File 'app/controllers/user/sign_ins_controller.rb', line 6 def new session_manager.sign_out @sign_in = SignIn.new() end |
#oauth_callback ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'app/controllers/user/sign_ins_controller.rb', line 17 def oauth_callback # TODO: do I need to check the provider param? There is on in oauth_data # and one in params. oauth_data = request.env["omniauth.auth"] oauth_error = request.env["omniauth.error"] # TODO: The host app should be able to do a sign_up here instead @sign_in = SignIn.new(oauth_data: oauth_data, oauth_error: oauth_error).sign_in_with(Identities::OAuth) perform_sign_in @sign_in end |