Skip to content

Commit 7ea2ffa

Browse files
lunnyKN4CK3R
andauthored
Fix SSPI user creation (#28948) (#29323)
Fixes #28945 Backport #28948 Setting the avatar is wrong and creating a random password is equal to leave it empty. Co-authored-by: KN4CK3R <[email protected]>
1 parent fdb0d03 commit 7ea2ffa

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

services/auth/sspi.go

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import (
1111
"sync"
1212

1313
"code.gitea.io/gitea/models/auth"
14-
"code.gitea.io/gitea/models/avatars"
1514
user_model "code.gitea.io/gitea/models/user"
1615
"code.gitea.io/gitea/modules/base"
1716
gitea_context "code.gitea.io/gitea/modules/context"
@@ -163,12 +162,9 @@ func (s *SSPI) shouldAuthenticate(req *http.Request) (shouldAuth bool) {
163162
func (s *SSPI) newUser(ctx context.Context, username string, cfg *sspi.Source) (*user_model.User, error) {
164163
email := gouuid.New().String() + "@localhost.localdomain"
165164
user := &user_model.User{
166-
Name: username,
167-
Email: email,
168-
Passwd: gouuid.New().String(),
169-
Language: cfg.DefaultLanguage,
170-
UseCustomAvatar: true,
171-
Avatar: avatars.DefaultAvatarLink(),
165+
Name: username,
166+
Email: email,
167+
Language: cfg.DefaultLanguage,
172168
}
173169
emailNotificationPreference := user_model.EmailNotificationsDisabled
174170
overwriteDefault := &user_model.CreateUserOverwriteOptions{

0 commit comments

Comments
 (0)