Skip to content

Commit

Permalink
Flesh out the reset of the Auth Hash
Browse files Browse the repository at this point in the history
  • Loading branch information
jjbohn committed Feb 24, 2014
1 parent 2324344 commit bfdf5c6
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/omniauth/strategies/openid-connect.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ class OpenIDConnect
{
name: user_info.name,
email: user_info.email,
nickname: user_info.nickname,
first_name: user_info.given_name,
last_name: user_info.family_name,
image: user_info.picture,
phone: user_info.phone_number,
urls: { website: user_info.website }
}
end

Expand Down
6 changes: 6 additions & 0 deletions test/lib/omniauth/strategies/openid-connect_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,11 @@ def test_info
info = strategy.info
assert_equal user_info.name, info[:name]
assert_equal user_info.email, info[:email]
assert_equal user_info.nickname, info[:nickname]
assert_equal user_info.given_name, info[:first_name]
assert_equal user_info.family_name, info[:last_name]
assert_equal user_info.picture, info[:image]
assert_equal user_info.phone_number, info[:phone]
assert_equal({ website: user_info.website }, info[:urls])
end
end
6 changes: 6 additions & 0 deletions test/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ def user_info
info.stubs(:sub).returns(SecureRandom.hex(16))
info.stubs(:name).returns(Faker::Name.name)
info.stubs(:email).returns(Faker::Internet.email)
info.stubs(:nickname).returns(Faker::Internet.user_name)
info.stubs(:given_name).returns(Faker::Name.first_name)
info.stubs(:family_name).returns(Faker::Name.last_name)
info.stubs(:picture).returns(Faker::Internet.url + ".png")
info.stubs(:phone_number).returns(Faker::PhoneNumber.phone_number)
info.stubs(:website).returns(Faker::Internet.url)
end
end

Expand Down

0 comments on commit bfdf5c6

Please sign in to comment.