feat: kickstart google callbacks

This commit is contained in:
Shivam Mishra
2024-05-30 19:10:13 +05:30
parent d51e3ad5bf
commit 32f25e3bd7
2 changed files with 19 additions and 0 deletions
@@ -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
+1
View File
@@ -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