Avoid empty domain overwrite (#2252)

This commit is contained in:
pascal-fischer 2024-07-10 14:08:35 +02:00 committed by GitHub
parent 85e991ff78
commit e8c2fafccd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -937,7 +937,7 @@ func (am *DefaultAccountManager) GetOrCreateAccountByUser(ctx context.Context, u
userObj := account.Users[userID]
if account.Domain != lowerDomain && userObj.Role == UserRoleOwner {
if lowerDomain != "" && account.Domain != lowerDomain && userObj.Role == UserRoleOwner {
account.Domain = lowerDomain
err = am.Store.SaveAccount(ctx, account)
if err != nil {