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

Adds #credentials and #extra that will be automatically picked up in the auth hash.

This commit is contained in:
Michael Bleigh 2011-09-27 20:20:58 -05:00
parent 13aa9418c8
commit 699c9661e3

View file

@ -264,9 +264,25 @@ module OmniAuth
raise NotImplementedError
end
# @abstract Override this method and return a hash containing any information
# needed to authorize the authenticating user to an API for the strategy.
def credentials
nil
end
# @abstract Override this method and return a hash containing any information
# that you believe will be useful for the user but doesn't fit in anywhere
# else. An example might be the raw user info hash from the API that contains
# information not specified in the auth hash schema.
def extra
nil
end
def auth_hash
hash = AuthHash.new(:provider => name, :uid => uid)
hash.info = info unless skip_info?
hash.credentials = credentials if credentials
hash.extra = extra if extra
hash
end