Merge pull request #12 from mrosack/master

fix to get avatar to download on initial account create, not just subsequent logins
This commit is contained in:
Jonathan de Faye 2017-01-21 16:01:52 +00:00 committed by GitHub
commit 81854b0dc8
1 changed files with 3 additions and 1 deletions

View File

@ -28,7 +28,7 @@ class SteamAuthenticator < ::Auth::Authenticator
result.username = data["nickname"]
result.name = data["name"] # unless profile privacy set to private
result.extra_data = { steam_uid: steam_uid }
result.extra_data = { steam_uid: steam_uid, image: data["image"] }
retrieve_avatar(result.user, data["image"])
@ -46,6 +46,8 @@ class SteamAuthenticator < ::Auth::Authenticator
def after_create_account(user, auth)
data = auth[:extra_data]
::PluginStore.set('steam', "steam_uid_#{data[:steam_uid]}", {user_id: user.id })
retrieve_avatar(user, data[:image])
end
def register_middleware(omniauth)