Class: OmniauthCallbacksController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/omniauth_callbacks_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



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 , alert: "Google sign-in failed. Please try again."
end

#failureObject



14
15
16
# File 'app/controllers/omniauth_callbacks_controller.rb', line 14

def failure
  redirect_to , alert: "Google sign-in failed. Please try again."
end