diff --git a/Gemfile b/Gemfile index 6f79e82..df3f547 100644 --- a/Gemfile +++ b/Gemfile @@ -88,6 +88,7 @@ gem "omniauth", "~> 2.0" # gem 'omniauth-zoom' # gem "omniauth-github" gem "omniauth-twitter" +gem "omniauth-google-oauth2" # gem 'omniauth-stripe' gem "omniauth-discord" gem "omniauth-twitch" diff --git a/Gemfile.lock b/Gemfile.lock index 260b139..5b6acd2 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -367,6 +367,7 @@ GEM method_source (1.1.0) mini_magick (4.12.0) mini_mime (1.1.5) + mini_portile2 (2.8.7) minitest (5.24.1) mrsk (0.15.1) activesupport (>= 7.0) @@ -396,11 +397,8 @@ GEM net-protocol net-ssh (7.2.0) nio4r (2.7.3) - nokogiri (1.16.6-arm64-darwin) - racc (~> 1.4) - nokogiri (1.16.6-x86_64-darwin) - racc (~> 1.4) - nokogiri (1.16.6-x86_64-linux) + nokogiri (1.16.6) + mini_portile2 (~> 2.8.2) racc (~> 1.4) oauth (1.1.0) oauth-tty (~> 1.0, >= 1.0.1) @@ -422,6 +420,10 @@ GEM omniauth-discord (1.1.0) omniauth (~> 2.1.0) omniauth-oauth2 + omniauth-google-oauth2 (0.8.0) + jwt (>= 2.0) + omniauth (>= 1.1.1) + omniauth-oauth2 (>= 1.6) omniauth-oauth (1.2.0) oauth omniauth (>= 1.0, < 3) @@ -643,10 +645,7 @@ GEM zeitwerk (2.6.16) PLATFORMS - arm64-darwin-21 - arm64-darwin-22 - x86_64-darwin-23 - x86_64-linux + ruby DEPENDENCIES aasm (~> 5.2) @@ -684,6 +683,7 @@ DEPENDENCIES mrsk (~> 0.15.1) omniauth (~> 2.0) omniauth-discord + omniauth-google-oauth2 omniauth-rails_csrf_protection omniauth-twitch omniauth-twitter diff --git a/app/controllers/users/omniauth_callbacks_controller.rb b/app/controllers/users/omniauth_callbacks_controller.rb index 9cd8f2e..2d4aec9 100644 --- a/app/controllers/users/omniauth_callbacks_controller.rb +++ b/app/controllers/users/omniauth_callbacks_controller.rb @@ -80,6 +80,12 @@ def twitch callback_handler end + def google_oauth2 + logger.info("Callback Google") + # logger.info(session.to_json) + callback_handler + end + private def callback_handler diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 31829eb..3ca4f3c 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -455,6 +455,14 @@ def icon_for(kind) HTML + when :google_oauth2 + <<-HTML + + + + + HTML + when :twitter <<-HTML