fix(auth): 注册接口安全加固 - 默认关闭注册
This commit is contained in:
@@ -184,7 +184,9 @@ func TestAuthService_Register_CheckEmailError(t *testing.T) {
|
||||
|
||||
func TestAuthService_Register_ReservedEmail(t *testing.T) {
|
||||
repo := &userRepoStub{}
|
||||
service := newAuthService(repo, nil, nil)
|
||||
service := newAuthService(repo, map[string]string{
|
||||
SettingKeyRegistrationEnabled: "true",
|
||||
}, nil)
|
||||
|
||||
_, _, err := service.Register(context.Background(), "linuxdo-123@linuxdo-connect.invalid", "password")
|
||||
require.ErrorIs(t, err, ErrEmailReserved)
|
||||
|
||||
Reference in New Issue
Block a user