Fix user cache lookup filtering for service users (#849)

This commit is contained in:
pascal-fischer 2023-05-10 19:27:17 +02:00 committed by GitHub
parent 6f2c4078ef
commit e4c28f64fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -902,7 +902,9 @@ func (am *DefaultAccountManager) lookupUserInCacheByEmail(email string, accountI
func (am *DefaultAccountManager) lookupUserInCache(userID string, account *Account) (*idp.UserData, error) {
users := make(map[string]struct{}, len(account.Users))
for _, user := range account.Users {
users[user.Id] = struct{}{}
if !user.IsServiceUser {
users[user.Id] = struct{}{}
}
}
log.Debugf("looking up user %s of account %s in cache", userID, account.Id)
userData, err := am.lookupCache(users, account.Id)