@@ -31,7 +31,7 @@ import (
31
31
user_service "code.gitea.io/gitea/services/user"
32
32
)
33
33
34
- func parseAuthSource (ctx * context.APIContext , u * user_model.User , sourceID int64 , loginName string ) {
34
+ func parseAuthSource (ctx * context.APIContext , u * user_model.User , sourceID int64 ) {
35
35
if sourceID == 0 {
36
36
return
37
37
}
@@ -48,7 +48,6 @@ func parseAuthSource(ctx *context.APIContext, u *user_model.User, sourceID int64
48
48
49
49
u .LoginType = source .Type
50
50
u .LoginSource = source .ID
51
- u .LoginName = loginName
52
51
}
53
52
54
53
// CreateUser create a user
@@ -84,12 +83,13 @@ func CreateUser(ctx *context.APIContext) {
84
83
Passwd : form .Password ,
85
84
MustChangePassword : true ,
86
85
LoginType : auth .Plain ,
86
+ LoginName : form .LoginName ,
87
87
}
88
88
if form .MustChangePassword != nil {
89
89
u .MustChangePassword = * form .MustChangePassword
90
90
}
91
91
92
- parseAuthSource (ctx , u , form .SourceID , form . LoginName )
92
+ parseAuthSource (ctx , u , form .SourceID )
93
93
if ctx .Written () {
94
94
return
95
95
}
@@ -192,7 +192,7 @@ func EditUser(ctx *context.APIContext) {
192
192
193
193
form := web .GetForm (ctx ).(* api.EditUserOption )
194
194
195
- parseAuthSource (ctx , ctx .ContextUser , form .SourceID , form . LoginName )
195
+ parseAuthSource (ctx , ctx .ContextUser , form .SourceID )
196
196
if ctx .Written () {
197
197
return
198
198
}
0 commit comments