La photo de profil téléchargée est constamment remplacée par 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 « J'aime »

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 « J'aime »

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 « J'aime »

Veuillez excuser ma remontée de ce vieux sujet, je pense que nous rencontrons actuellement le même comportement sur un site. Ce bug a-t-il été identifié et résolu ?
Les avatars des utilisateurs semblent être réinitialisés aléatoirement à gravatar, bien que nous ayons explicitement supprimé tous les paramètres liés à gravatar (en décochant ou en supprimant tous les paramètres contenant gravatar).