diff --git a/app/controllers/google_sign_in/base_controller.rb b/app/controllers/google_sign_in/base_controller.rb index 340997c..5c630c4 100644 --- a/app/controllers/google_sign_in/base_controller.rb +++ b/app/controllers/google_sign_in/base_controller.rb @@ -9,7 +9,7 @@ def client GoogleSignIn.client_id, GoogleSignIn.client_secret, authorize_url: 'https://accounts.google.com/o/oauth2/auth', - token_url: 'https://www.googleapis.com/oauth2/v3/token', + token_url: 'https://www.googleapis.com/oauth2/v4/token', redirect_uri: callback_url end end diff --git a/test/controllers/callbacks_controller_test.rb b/test/controllers/callbacks_controller_test.rb index 75bec5c..86f559f 100644 --- a/test/controllers/callbacks_controller_test.rb +++ b/test/controllers/callbacks_controller_test.rb @@ -27,7 +27,7 @@ class GoogleSignIn::CallbacksControllerTest < ActionDispatch::IntegrationTest private def stub_token_request(code:, **params) - stub_request(:post, 'https://www.googleapis.com/oauth2/v3/token'). + stub_request(:post, 'https://www.googleapis.com/oauth2/v4/token'). with(body: { grant_type: 'authorization_code', code: code, client_id: FAKE_GOOGLE_CLIENT_ID, client_secret: FAKE_GOOGLE_CLIENT_SECRET, redirect_uri: 'http://www.example.com/google_sign_in/callback' }).