NOISSUE - Fix SSO User metadata update (#3203)

Signed-off-by: dusan <borovcanindusan1@gmail.com>
This commit is contained in:
Dušan Borovčanin
2025-10-22 15:32:55 +02:00
committed by GitHub
parent 69366d77cc
commit 1b26264495
+11 -1
View File
@@ -299,7 +299,9 @@ func (svc service) Update(ctx context.Context, session authn.Session, id string,
return User{}, errors.Wrap(svcerr.ErrUpdateEntity, err)
}
if u.AuthProvider != "" {
if usr.FirstName != nil || usr.LastName != nil || usr.ProfilePicture != nil {
if changed(usr.FirstName, u.FirstName) ||
changed(usr.LastName, u.LastName) ||
changed(usr.ProfilePicture, u.ProfilePicture) {
return User{}, svcerr.ErrExternalAuthProviderCouldNotUpdate
}
}
@@ -804,3 +806,11 @@ func sanitizeForUsername(s string, maxLen int) string {
return cleaned
}
func changed(updated *string, old string) bool {
if updated == nil {
return false
}
return *updated != old
}