Uploaded profile pic keeps getting over-ridden by gravatar (DiscourseConnect)

Hi,
I’m using SSO for users to log in.

I noticed that we can upload a custom profile pic and choose an option to use it, but after logging out and logging in again, our profile pic is auto-replaced by the Gravatars. Is this a bug?

I have the setting, “automatically download gravatars” enabled, but I supposed this is for users upon account creation or email change. If users have already chosen to use their custom pic instead of the gravatar, it shouldn’t be overridden?

1 Like

If you SSO is set to override user avatars/profile pictures, it will update the Discourse avatar every time it syncs, which happens when user’s log in.

Hi @osioke

Do you mean the setting here:

I didn’t enable it for Discourse Connect (SSO) to override user avatar.

I’ve only enabled the Gravatar to auto download (but not override):

So I think this is what’s causing the problem of overriding user’s custom avatar.

I think it goes back to the issue: whether users can choose to prioritize custom pics over gravatars.

Because although gravatars are automatically loaded, if the user chooses to use custom pic in their profile, this choice should be recorded/remembered when we click Save Changes.

chrome_aQrzkCLTSc

What’s happening now is our choice of profile pic is constantly overridden by the system upon re-logging in or reloading.

1 Like

This does sound like a bug. The logic we have here is

https://github.com/discourse/discourse/blob/eb25d3a954d03792bce29cda01420807842df25f/app/models/discourse_single_sign_on.rb#L318-L326

Assuming discourse connect overrides avatar is off, that means we should only be changing the avatar when both of these are true:

  • The user has not chosen an avatar in Discourse
  • The identity provider is sending an avatar in the DiscourseConnect payload

It sounds like something might be going wrong here. @Soohian any chance you could share the URL to your site via PM?

2 Likes

Apologies for reviving this old topic, I believe we’re experiencing this same behavior on a site right now. Was this bug identified and resolved?
avatars for users seem to get reset to gravatar randomly despite us having all gravatar related settings explicitly nuked (by unchecking or removing every setting that has gravatar in it)