fix(auth): 注册接口安全加固 - 默认关闭注册

This commit is contained in:
shaw
2026-01-09 14:49:20 +08:00
committed by admin
parent d1c2a61d19
commit 1a1e23fc76

View File

@@ -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)