mirror of
https://github.com/discourse/discourse.git
synced 2025-05-24 14:12:10 +08:00
FIX: Improve avatar loading, and add tests
Follow-up from 4e2cc9c
This commit is contained in:
@ -72,7 +72,7 @@ class Auth::ManagedAuthenticator < Auth::Authenticator
|
||||
credentials: auth_token[:credentials] || {},
|
||||
extra: auth_token[:extra] || {}
|
||||
)
|
||||
retrieve_avatar(result.user, auth_token[:info][:image])
|
||||
retrieve_avatar(result.user, auth_token.dig(:info, :image))
|
||||
end
|
||||
|
||||
result.email_valid = true if result.email
|
||||
@ -94,7 +94,7 @@ class Auth::ManagedAuthenticator < Auth::Authenticator
|
||||
def after_create_account(user, auth)
|
||||
data = auth[:extra_data]
|
||||
create_association!(data.merge(user: user))
|
||||
retrieve_avatar(user, data&.[]("info")&.[]("image"))
|
||||
retrieve_avatar(user, data.dig(:info, :image))
|
||||
end
|
||||
|
||||
def retrieve_avatar(user, url)
|
||||
|
Reference in New Issue
Block a user