mirror of https://github.com/cloudreve/Cloudreve
feat(captcha): update field names to Cap 2.0 standard - Site Key and Secret Key
parent
e92879aadd
commit
d7b731d168
|
@ -669,8 +669,8 @@ func (s *settingProvider) TurnstileCaptcha(ctx context.Context) *Turnstile {
|
||||||
func (s *settingProvider) CapCaptcha(ctx context.Context) *Cap {
|
func (s *settingProvider) CapCaptcha(ctx context.Context) *Cap {
|
||||||
return &Cap{
|
return &Cap{
|
||||||
InstanceURL: s.getString(ctx, "captcha_cap_instance_url", ""),
|
InstanceURL: s.getString(ctx, "captcha_cap_instance_url", ""),
|
||||||
SiteKey: s.getString(ctx, "captcha_cap_key_id", ""),
|
SiteKey: s.getString(ctx, "captcha_cap_site_key", ""),
|
||||||
SecretKey: s.getString(ctx, "captcha_cap_key_secret", ""),
|
SecretKey: s.getString(ctx, "captcha_cap_secret_key", ""),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,7 @@ type SiteConfig struct {
|
||||||
CaptchaType setting.CaptchaType `json:"captcha_type,omitempty"`
|
CaptchaType setting.CaptchaType `json:"captcha_type,omitempty"`
|
||||||
TurnstileSiteID string `json:"turnstile_site_id,omitempty"`
|
TurnstileSiteID string `json:"turnstile_site_id,omitempty"`
|
||||||
CapInstanceURL string `json:"captcha_cap_instance_url,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"`
|
RegisterEnabled bool `json:"register_enabled,omitempty"`
|
||||||
TosUrl string `json:"tos_url,omitempty"`
|
TosUrl string `json:"tos_url,omitempty"`
|
||||||
PrivacyPolicyUrl string `json:"privacy_policy_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,
|
TurnstileSiteID: settings.TurnstileCaptcha(c).Key,
|
||||||
ReCaptchaKey: reCaptcha.Key,
|
ReCaptchaKey: reCaptcha.Key,
|
||||||
CapInstanceURL: capCaptcha.InstanceURL,
|
CapInstanceURL: capCaptcha.InstanceURL,
|
||||||
CapKeyID: capCaptcha.SiteKey,
|
CapSiteKey: capCaptcha.SiteKey,
|
||||||
AppPromotion: appSetting.Promotion,
|
AppPromotion: appSetting.Promotion,
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue