From 8a9289c14269d9d906892e23ef5417523b99cd0b Mon Sep 17 00:00:00 2001 From: David Shorthouse Date: Wed, 20 Jul 2022 02:45:50 -0400 Subject: [PATCH] Remove query parameters from the callback_url As in the subject line & perhaps a little easier to manage than https://github.com/omniauth/omniauth-oauth2/pull/142. --- lib/omniauth/strategies/oauth2.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/omniauth/strategies/oauth2.rb b/lib/omniauth/strategies/oauth2.rb index e445214..7029248 100644 --- a/lib/omniauth/strategies/oauth2.rb +++ b/lib/omniauth/strategies/oauth2.rb @@ -123,7 +123,7 @@ def pkce_token_params def build_access_token verifier = request.params["code"] - client.auth_code.get_token(verifier, {:redirect_uri => callback_url}.merge(token_params.to_hash(:symbolize_keys => true)), deep_symbolize(options.auth_token_params)) + client.auth_code.get_token(verifier, {:redirect_uri => callback_url.split("?").first}.merge(token_params.to_hash(:symbolize_keys => true)), deep_symbolize(options.auth_token_params)) end def deep_symbolize(options)