Skip to content

Commit

Permalink
Fix SSPI user creation (go-gitea#28948)
Browse files Browse the repository at this point in the history
Fixes go-gitea#28945

Setting the avatar is wrong and creating a random password is equal to
leave it empty.
  • Loading branch information
KN4CK3R authored and silverwind committed Feb 20, 2024
1 parent 522ffbe commit 04ddcac
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions services/auth/sspi.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (
"sync"

"code.gitea.io/gitea/models/auth"
"code.gitea.io/gitea/models/avatars"
"code.gitea.io/gitea/models/db"
user_model "code.gitea.io/gitea/models/user"
"code.gitea.io/gitea/modules/base"
Expand Down Expand Up @@ -167,12 +166,9 @@ func (s *SSPI) shouldAuthenticate(req *http.Request) (shouldAuth bool) {
func (s *SSPI) newUser(ctx context.Context, username string, cfg *sspi.Source) (*user_model.User, error) {
email := gouuid.New().String() + "@localhost.localdomain"
user := &user_model.User{
Name: username,
Email: email,
Passwd: gouuid.New().String(),
Language: cfg.DefaultLanguage,
UseCustomAvatar: true,
Avatar: avatars.DefaultAvatarLink(),
Name: username,
Email: email,
Language: cfg.DefaultLanguage,
}
emailNotificationPreference := user_model.EmailNotificationsDisabled
overwriteDefault := &user_model.CreateUserOverwriteOptions{
Expand Down

0 comments on commit 04ddcac

Please sign in to comment.