Commit 1a1e23fc authored by shaw's avatar shaw Committed by admin
Browse files

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

parent d1c2a61d
...@@ -184,7 +184,9 @@ func TestAuthService_Register_CheckEmailError(t *testing.T) { ...@@ -184,7 +184,9 @@ func TestAuthService_Register_CheckEmailError(t *testing.T) {
func TestAuthService_Register_ReservedEmail(t *testing.T) { func TestAuthService_Register_ReservedEmail(t *testing.T) {
repo := &userRepoStub{} 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") _, _, err := service.Register(context.Background(), "linuxdo-123@linuxdo-connect.invalid", "password")
require.ErrorIs(t, err, ErrEmailReserved) require.ErrorIs(t, err, ErrEmailReserved)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment