1
0
Fork 0
mirror of https://github.com/omniauth/omniauth.git synced 2022-11-09 12:31:49 -05:00

refactor auth hash method

This commit is contained in:
Bobby McDonald 2020-12-08 11:00:16 -05:00 committed by GitHub
parent 1cd79a1769
commit 7f20a03d92
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -345,11 +345,13 @@ module OmniAuth
end
def auth_hash
hash = AuthHash.new(:provider => name, :uid => uid)
hash.info = info unless skip_info?
(credentials_data = credentials) && hash.credentials = credentials_data
(extra_data = extra) && hash.extra = extra_data
hash
credentials_data = credentials
extra_data = extra
AuthHash.new(:provider => name, :uid => uid).tap do |auth|
auth.info = info unless skip_info?
auth.credentials = credentials_data if credentials_data
auth.extra = extra_data if extra_data
end
end
# Determines whether or not user info should be retrieved. This