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

This commit is contained in:
shaw
2026-01-09 14:49:20 +08:00
parent 0a9c17b9d1
commit 43f104bdf7
4 changed files with 52 additions and 15 deletions

View File

@@ -141,8 +141,8 @@ func (s *SettingService) UpdateSettings(ctx context.Context, settings *SystemSet
func (s *SettingService) IsRegistrationEnabled(ctx context.Context) bool {
value, err := s.settingRepo.GetValue(ctx, SettingKeyRegistrationEnabled)
if err != nil {
// 默认开放注册
return true
// 安全默认:如果设置不存在或查询出错,默认关闭注册
return false
}
return value == "true"
}