Auth: Fix missing authLabels from user list page (#94612)

Fix slice initialization
This commit is contained in:
Misi 2024-10-11 14:42:32 +02:00 committed by GitHub
parent 01897edccd
commit 62738dd5c8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -112,7 +112,7 @@ func (s *OSSService) SearchUser(c *contextmodel.ReqContext) (*user.SearchUserQue
for _, user := range res.Users {
user.AvatarURL = dtos.GetGravatarUrl(s.cfg, user.Email)
user.AuthLabels = make([]string, len(user.AuthModule))
user.AuthLabels = make([]string, 0, len(user.AuthModule))
for _, authModule := range user.AuthModule {
user.AuthLabels = append(user.AuthLabels, login.GetAuthProviderLabel(authModule))
}