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:
parent
1cd79a1769
commit
7f20a03d92
1 changed files with 7 additions and 5 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue