feat: kickstart google callbacks
This commit is contained in:
@@ -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
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user