refactor(captcha): update Cap to 2.0.0 (#2573)

* refactor(captcha): update Cap backend to 2.0.0 API format

* feat(captcha): add Cap version config for 1.x/2.x compatibility

* fix(captcha): change Cap default version to 1.x for backward compatibility

* refactor(captcha): remove Cap 1.x compatibility, keep only 2.x support

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

* fix(captcha): update Cap field names in defaults configuration
This commit is contained in:
WittF
2025-06-26 14:58:58 +08:00
committed by GitHub
parent 3db522609e
commit 2500ebc6a4
5 changed files with 18 additions and 16 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", ""),
KeyID: s.getString(ctx, "captcha_cap_key_id", ""),
KeySecret: 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

@@ -50,8 +50,8 @@ type Turnstile struct {
type Cap struct {
InstanceURL string
KeyID string
KeySecret string
SiteKey string
SecretKey string
}
type SMTP struct {