[PR #2199] fix: update Google SSO user avatars on login #2138

Open
opened 2026-02-26 03:33:23 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/koel/koel/pull/2199
Author: @pwqw
Created: 1/19/2026
Status: 🔄 Open

Base: masterHead: fix/google-sso-avatar


📝 Commits (2)

  • fd9f9d5 fix: update Google SSO user avatars on login
  • 0a4640a fix(sso): improve Google avatar detection to support all CDN subdomains

📊 Changes

2 files changed (+14 additions, -3 deletions)

View changed files

📝 app/Observers/UserObserver.php (+5 -2)
📝 app/Services/UserService.php (+9 -1)

📄 Description

Previously, when a user logged in with Google SSO, their avatar from Google was not being updated if they already had an avatar stored in the database (even if it was a Google URL). This happened because has_custom_avatar was true for any stored avatar, including Google URLs.

Changes:

  • UserService: Detect if current avatar is a Google URL and update it on each SSO login, even if has_custom_avatar is true. Only preserve truly custom avatars (local files, not Google URLs).
  • UserObserver: Prevent attempting to delete external URLs (like Google avatars) as local files when updating avatars.

This ensures Google SSO users always have their latest profile picture from Google, while preserving user-uploaded custom avatars.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/koel/koel/pull/2199 **Author:** [@pwqw](https://github.com/pwqw) **Created:** 1/19/2026 **Status:** 🔄 Open **Base:** `master` ← **Head:** `fix/google-sso-avatar` --- ### 📝 Commits (2) - [`fd9f9d5`](https://github.com/koel/koel/commit/fd9f9d539f857b3285efadd735e6066a78185e0d) fix: update Google SSO user avatars on login - [`0a4640a`](https://github.com/koel/koel/commit/0a4640a4ea82df1df427b0551dc5cb4c1b6d78c4) fix(sso): improve Google avatar detection to support all CDN subdomains ### 📊 Changes **2 files changed** (+14 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `app/Observers/UserObserver.php` (+5 -2) 📝 `app/Services/UserService.php` (+9 -1) </details> ### 📄 Description Previously, when a user logged in with Google SSO, their avatar from Google was not being updated if they already had an avatar stored in the database (even if it was a Google URL). This happened because has_custom_avatar was true for any stored avatar, including Google URLs. Changes: - UserService: Detect if current avatar is a Google URL and update it on each SSO login, even if has_custom_avatar is true. Only preserve truly custom avatars (local files, not Google URLs). - UserObserver: Prevent attempting to delete external URLs (like Google avatars) as local files when updating avatars. This ensures Google SSO users always have their latest profile picture from Google, while preserving user-uploaded custom avatars. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/koel-koel#2138
No description provided.