Class: OmniauthCallbacksController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- OmniauthCallbacksController
- Defined in:
- app/controllers/omniauth_callbacks_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
4 5 6 7 8 9 10 11 12 |
# File 'app/controllers/omniauth_callbacks_controller.rb', line 4 def create user = User.from_omniauth(request.env["omniauth.auth"]) rescue_and_log(target: user) do set_app_session(user) redirect_to root_path, notice: "Signed in with Google!" end rescue StandardError => e redirect_to login_path, alert: "Google sign-in failed. Please try again." end |
#failure ⇒ Object
14 15 16 |
# File 'app/controllers/omniauth_callbacks_controller.rb', line 14 def failure redirect_to login_path, alert: "Google sign-in failed. Please try again." end |