Skip to content
This repository was archived by the owner on Jan 5, 2024. It is now read-only.

Commit c282a09

Browse files
committed
Compatibility with omniauth-oauth2 >= 1.4
* omniauth/omniauth-oauth2@2615267 * omniauth/omniauth-oauth2#70
1 parent 1bde683 commit c282a09

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

lib/omniauth/strategies/greenhouse.rb

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,18 @@ class Greenhouse < OmniAuth::Strategies::OAuth2
2020
def raw_info
2121
@raw_info ||= access_token.get('/v1/partner/current_user').parsed
2222
end
23+
24+
# Override callback URL for compatibility with omniauth-oauth2 >= 1.4,
25+
# which by default passes the entire URL of the callback, including
26+
# query parameters. Greenhouse fails validation because that doesn't match the
27+
# registered callback as required in the Oauth 2.0 spec.
28+
# Refs:
29+
# https://tools.ietf.org/html/rfc6749#section-4.1.3
30+
# https://github.com/omniauth/omniauth-oauth2/commit/26152673224aca5c3e918bcc83075dbb0659717f
31+
# https://github.com/omniauth/omniauth-oauth2/pull/70
32+
def callback_url
33+
optioins[:redirect_uri] || (full_host + script_name + callback_path)
34+
end
2335
end
2436
end
2537
end

0 commit comments

Comments
 (0)