用户上传的头像持续被 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 个赞

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 个赞

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 个赞

抱歉重新提起这个旧话题,我认为我们现在也在一个站点上遇到同样的行为。这个 bug 是否已被识别和解决?

用户头像似乎会随机重置为 gravatar,尽管我们已经明确禁用了所有与 gravatar 相关的设置(通过取消选中或删除包含 gravatar 的每个设置)。