pnoeric is using SSO to pass user data including avatar_url and avatar_force_update to Discourse, but the avatar for their admin user refuses to update despite the code executing and Sidekiq being idle. simon confirms the parameters look correct and notes admin status shouldn’t matter, suggesting to verify the avatar_url and test with a new user. pnoeric reports the avatar update works for other users but not the admin, and suspects the issue may stem from the admin’s avatar originally being pulled from Gravatar — which is now disabled — and wonders if that legacy setting is preventing the forced update.
I’m using SSO and passing this array when the user logs in:
// and finally build the big array we're passing to discourse
$userParams = [
'external_id' => $userObject->getID(),
'email' => $userObject->getEmail(),
'username' => $name,
'avatar_url' => $forumThumbURL,
'avatar_force_update' => 'true',
'groups' => implode( ',', $groupsArray ),
];
Here’s the problem, the avatar is never updated. I’m stuck with an old avatar on the site and it won’t seem to change. I can log in and out, I know this code is being called, but no change. My sidekiq queue is at 0.
It’s for an admin user, would that make any difference?
The parameters you are passing look correct to me. It should not make any difference that you are trying to set the avatar for an admin user. Are you sure that the avatar_url you are passing is correct? If you try logging in as a new user, does the avatar get set correctly?
Hey, thanks for the reply. So I tried this with a different user – and for that user it’s working. But for my admin user, no go, it won’t let go of the image it has.
I realized that the image for my admin is the one it downloaded from Gravatar (when I first set up my forum), and since then I’ve completely turned off Gravatar. But could that have something to do with why it won’t let it go?