feat(captcha): update field names to Cap 2.0 standard - Site Key and Secret Key

pull/2573/head
WittF 2025-06-26 05:48:46 +08:00
parent e92879aadd
commit d7b731d168
2 changed files with 4 additions and 4 deletions

View File

@ -669,8 +669,8 @@ func (s *settingProvider) TurnstileCaptcha(ctx context.Context) *Turnstile {
func (s *settingProvider) CapCaptcha(ctx context.Context) *Cap {
return &Cap{
InstanceURL: s.getString(ctx, "captcha_cap_instance_url", ""),
SiteKey: s.getString(ctx, "captcha_cap_key_id", ""),
SecretKey: s.getString(ctx, "captcha_cap_key_secret", ""),
SiteKey: s.getString(ctx, "captcha_cap_site_key", ""),
SecretKey: s.getString(ctx, "captcha_cap_secret_key", ""),
}
}

View File

@ -30,7 +30,7 @@ type SiteConfig struct {
CaptchaType setting.CaptchaType `json:"captcha_type,omitempty"`
TurnstileSiteID string `json:"turnstile_site_id,omitempty"`
CapInstanceURL string `json:"captcha_cap_instance_url,omitempty"`
CapKeyID string `json:"captcha_cap_key_id,omitempty"`
CapSiteKey string `json:"captcha_cap_site_key,omitempty"`
RegisterEnabled bool `json:"register_enabled,omitempty"`
TosUrl string `json:"tos_url,omitempty"`
PrivacyPolicyUrl string `json:"privacy_policy_url,omitempty"`
@ -137,7 +137,7 @@ func (s *GetSettingService) GetSiteConfig(c *gin.Context) (*SiteConfig, error) {
TurnstileSiteID: settings.TurnstileCaptcha(c).Key,
ReCaptchaKey: reCaptcha.Key,
CapInstanceURL: capCaptcha.InstanceURL,
CapKeyID: capCaptcha.SiteKey,
CapSiteKey: capCaptcha.SiteKey,
AppPromotion: appSetting.Promotion,
}, nil
}