diff --git a/app/controllers/google/callbacks_controller.rb b/app/controllers/google/callbacks_controller.rb new file mode 100644 index 000000000..4fc31f990 --- /dev/null +++ b/app/controllers/google/callbacks_controller.rb @@ -0,0 +1,18 @@ +class Google::CallbacksController < ApplicationController + def handle_response + redirect_to '/' + end + + private + + def oauth_client + app_id = GlobalConfigService.load('GOOGLE_OAUTH_CLIENT_ID', nil) + app_secret = GlobalConfigService.load('GOOGLE_OAUTH_CLIENT_SECRET', nil) + + ::OAuth2::Client.new(app_id, app_secret, { + site: 'https://oauth2.googleapis.com', + authorize_url: 'https://accounts.google.com/o/oauth2/auth', + token_url: '/token' + }) + end +end diff --git a/config/routes.rb b/config/routes.rb index f28a8d7ef..9176155da 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -445,6 +445,7 @@ Rails.application.routes.draw do end get 'microsoft/callback', to: 'microsoft/callbacks#show' + get 'google/callback', to: 'google/callbacks#show' # ---------------------------------------------------------------------- # Routes for external service verifications