Skip to content

Commit e0304e7

Browse files
committed
Merge pull request #27 from spraints/html_url
Set info.urls['GitHub'] from the user info
2 parents 48d718c + dcc846a commit e0304e7

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

lib/omniauth/strategies/github.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def authorize_params
3232
'name' => raw_info['name'],
3333
'image' => raw_info['avatar_url'],
3434
'urls' => {
35-
'GitHub' => "https://github.com/#{raw_info['login']}",
35+
'GitHub' => raw_info['html_url'],
3636
'Blog' => raw_info['blog'],
3737
},
3838
}

spec/omniauth/strategies/github_spec.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,4 +132,11 @@
132132
end
133133
end
134134

135+
context '#info.urls' do
136+
it 'should use html_url from raw_info' do
137+
subject.stub(:raw_info).and_return({ 'login' => 'me', 'html_url' => 'http://enterprise/me' })
138+
subject.info['urls']['GitHub'].should == 'http://enterprise/me'
139+
end
140+
end
141+
135142
end

0 commit comments

Comments
 (0)