We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents a893c2b + d8d5c21 commit 1888397Copy full SHA for 1888397
2 files changed
lib/omniauth/strategies/github.rb
@@ -69,6 +69,10 @@ def email_access_allowed?
69
scopes = options['scope'].split(',')
70
(scopes & email_scopes).any?
71
end
72
+
73
+ def callback_url
74
+ full_host + script_name + callback_path
75
+ end
76
77
78
spec/omniauth/strategies/github_spec.rb
@@ -149,4 +149,13 @@
149
expect(subject.info['urls']['GitHub']).to eq('http://enterprise/me')
150
151
152
153
+ describe '#callback_url' do
154
+ it 'is a combination of host, script name, and callback path' do
155
+ allow(subject).to receive(:full_host).and_return('https://example.com')
156
+ allow(subject).to receive(:script_name).and_return('/sub_uri')
157
158
+ expect(subject.callback_url).to eq('https://example.com/sub_uri/auth/github/callback')
159
160
161
0 commit comments