From d47be6d679d5ad19810cc21cea3ce4d5c1fe2d40 Mon Sep 17 00:00:00 2001 From: Kimihiko NAKAMURA Date: Mon, 25 Jan 2016 18:33:05 +0900 Subject: [PATCH] Redifine callback_url to remove query strings Follow the change made in `omniauth-oauth2` gem v1.4.0, https://github.com/intridea/omniauth-oauth2/commit/26152673224aca5c3e918bcc83075dbb0659717f which changed OmniAuth::Strategies::OAuth2#callback_url to include query strings, while it is used to create `redirect_uri`, which should not include querey strings. As https://github.com/intridea/omniauth-oauth2/issues/81 ( especially https://github.com/intridea/omniauth-oauth2/issues/81#issuecomment-168899933 ) suggests, downstream gems are to define their own `callback_url`. --- lib/omniauth/strategies/mixi.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/omniauth/strategies/mixi.rb b/lib/omniauth/strategies/mixi.rb index b82a634..e7a31ab 100644 --- a/lib/omniauth/strategies/mixi.rb +++ b/lib/omniauth/strategies/mixi.rb @@ -49,6 +49,10 @@ def raw_info access_token.get('/2/people/@me/@self?fields=@all').parsed['entry'] end + def callback_url + full_host + script_name + callback_path + end + def authorize_params super.tap do |params| %w[display state scope].each do |v|