Skip to content

Commit de3bd0c

Browse files
author
Jiri Vlasak
committed
Enable manual confirmation of new registered user
When manual registration confirmation is desired (by default `false`) create new user in the database that is *not active*. The user must then be activated manually. This change speeds up the process of adding new confirmed users for Gitea instances without external auth mechanism. (Currently the option is to manually create new user by admin.)
1 parent 1f8d6ea commit de3bd0c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

routers/user/auth.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -949,7 +949,7 @@ func LinkAccountPostRegister(ctx *context.Context, cpt *captcha.Captcha, form au
949949
Name: form.UserName,
950950
Email: form.Email,
951951
Passwd: form.Password,
952-
IsActive: !setting.Service.RegisterEmailConfirm,
952+
IsActive: !(setting.Service.RegisterEmailConfirm || setting.Service.RegisterManualConfirm),
953953
LoginType: models.LoginOAuth2,
954954
LoginSource: loginSource.ID,
955955
LoginName: gothUser.(goth.User).UserID,
@@ -1144,7 +1144,7 @@ func SignUpPost(ctx *context.Context, cpt *captcha.Captcha, form auth.RegisterFo
11441144
Name: form.UserName,
11451145
Email: form.Email,
11461146
Passwd: form.Password,
1147-
IsActive: !setting.Service.RegisterEmailConfirm,
1147+
IsActive: !(setting.Service.RegisterEmailConfirm || setting.Service.RegisterManualConfirm),
11481148
}
11491149
if err := models.CreateUser(u); err != nil {
11501150
switch {

0 commit comments

Comments
 (0)