diff --git a/app/Http/Controllers/Admin/AdminSettingsController.php b/app/Http/Controllers/Admin/AdminSettingsController.php index ce02566ca..e59b4ee72 100644 --- a/app/Http/Controllers/Admin/AdminSettingsController.php +++ b/app/Http/Controllers/Admin/AdminSettingsController.php @@ -740,7 +740,7 @@ trait AdminSettingsController ConfigCacheService::put('captcha.active.login', $request->boolean('captcha_on_login')); ConfigCacheService::put('captcha.active.register', $request->boolean('captcha_on_register')); - ConfigCacheService::put('captcha.active.forgot_password', $request->boolean('captcha_on_forgotpassword')); + ConfigCacheService::put('captcha.active.forgot_password', $request->boolean('captcha_on_forgot_password')); ConfigCacheService::put('captcha.active.password_reset', $request->boolean('captcha_on_password_reset')); ConfigCacheService::put('captcha.active.forgot_email', $request->boolean('captcha_on_forgot_email')); ConfigCacheService::put('captcha.active.curated_register', $request->boolean('captcha_on_curated_register')); @@ -760,7 +760,7 @@ trait AdminSettingsController 'captcha_driver' => $request->input('captcha_driver', 'hcaptcha'), 'captcha_on_login' => $request->boolean('captcha_on_login'), 'captcha_on_register' => $request->boolean('captcha_on_register'), - 'captcha_on_forgotpassword' => $request->boolean('captcha_on_forgotpassword'), + 'captcha_on_forgot_password' => $request->boolean('captcha_on_forgot_password'), 'captcha_on_password_reset' => $request->boolean('captcha_on_password_reset'), 'captcha_on_forgot_email' => $request->boolean('captcha_on_forgot_email'), 'captcha_on_curated_register' => $request->boolean('captcha_on_curated_register'), diff --git a/app/Http/Controllers/Auth/ForgotPasswordController.php b/app/Http/Controllers/Auth/ForgotPasswordController.php index e9c6cab72..28714dfc5 100644 --- a/app/Http/Controllers/Auth/ForgotPasswordController.php +++ b/app/Http/Controllers/Auth/ForgotPasswordController.php @@ -65,7 +65,7 @@ class ForgotPasswordController extends Controller ]; $messages = []; - if (app('captcha.manager')->activeOn('forgotpassword')) { + if (app('captcha.manager')->activeOn('forgot_password')) { $captchaField = app('captcha.manager')->active()->responseField(); $rules[$captchaField] = 'required|captcha_verify'; $messages[$captchaField] = 'Failed to validate the captcha.'; diff --git a/app/Services/AdminSettingsService.php b/app/Services/AdminSettingsService.php index 7822ac0b3..b0defc516 100644 --- a/app/Services/AdminSettingsService.php +++ b/app/Services/AdminSettingsService.php @@ -134,7 +134,7 @@ class AdminSettingsService 'captcha_driver' => config_cache('captcha.driver') ?: config('captcha.driver', 'hcaptcha'), 'captcha_on_login' => (bool) config_cache('captcha.active.login'), 'captcha_on_register' => (bool) config_cache('captcha.active.register'), - 'captcha_on_forgotpassword' => (bool) config_cache('captcha.active.forgot_password'), + 'captcha_on_forgot_password' => (bool) config_cache('captcha.active.forgot_password'), 'captcha_on_password_reset' => (bool) config_cache('captcha.active.password_reset'), 'captcha_on_forgot_email' => (bool) config_cache('captcha.active.forgot_email'), 'captcha_on_curated_register' => (bool) config_cache('captcha.active.curated_register'), diff --git a/app/Services/Captcha/CaptchaManager.php b/app/Services/Captcha/CaptchaManager.php index ef27767bb..3bc6892e9 100644 --- a/app/Services/Captcha/CaptchaManager.php +++ b/app/Services/Captcha/CaptchaManager.php @@ -64,8 +64,8 @@ class CaptchaManager extends Manager * Whether captcha should be enforced on a given surface. * * Requires the global toggle plus the per-surface "active" flag. Supported - * surfaces: login, register, forgotpassword, password_reset, - * curated_register. + * surfaces: login, register, forgot_password, password_reset, + * forgot_email, curated_register. */ public function activeOn(string $surface): bool { diff --git a/resources/assets/components/admin/AdminSettings.vue b/resources/assets/components/admin/AdminSettings.vue index 651efd599..ce8d57ee5 100644 --- a/resources/assets/components/admin/AdminSettings.vue +++ b/resources/assets/components/admin/AdminSettings.vue @@ -521,11 +521,11 @@
- + id="captcha_on_forgot_password" + v-model="platform.captcha_on_forgot_password"> +
@@ -1522,7 +1522,7 @@ captcha_cap_secret: this.platform.captcha_cap_secret, captcha_on_login: this.platform.captcha_on_login, captcha_on_register: this.platform.captcha_on_register, - captcha_on_forgotpassword: this.platform.captcha_on_forgotpassword, + captcha_on_forgot_password: this.platform.captcha_on_forgot_password, captcha_on_password_reset: this.platform.captcha_on_password_reset, captcha_on_forgot_email: this.platform.captcha_on_forgot_email, captcha_on_curated_register: this.platform.captcha_on_curated_register, diff --git a/resources/views/auth/passwords/email.blade.php b/resources/views/auth/passwords/email.blade.php index 7c445714c..5ce5a05ac 100644 --- a/resources/views/auth/passwords/email.blade.php +++ b/resources/views/auth/passwords/email.blade.php @@ -54,7 +54,7 @@
- +
diff --git a/resources/views/components/captcha.blade.php b/resources/views/components/captcha.blade.php index 8e0571a5e..bc82c9980 100644 --- a/resources/views/components/captcha.blade.php +++ b/resources/views/components/captcha.blade.php @@ -1,6 +1,6 @@ @props([ - /* Surface name to gate on (login, register, forgotpassword, password_reset, - curated_register). Ignored when :show is passed explicitly. */ + /* Surface name to gate on (login, register, forgot_password, password_reset, + forgot_email, curated_register). Ignored when :show is passed explicitly. */ 'surface' => null, /* Explicit visibility override for compound conditions (login triggers, curated registration). When null, visibility is derived from $surface. */ diff --git a/tests/Feature/CaptchaManagerTest.php b/tests/Feature/CaptchaManagerTest.php index 3b14cbc09..049ae328c 100644 --- a/tests/Feature/CaptchaManagerTest.php +++ b/tests/Feature/CaptchaManagerTest.php @@ -136,7 +136,7 @@ class CaptchaManagerTest extends TestCase 'captcha.enabled' => true, 'captcha.active.login' => true, 'captcha.active.register' => false, - 'captcha.active.forgot_password' => true, + 'captcha.active.forgotpassword' => true, 'captcha.active.password_reset' => false, 'captcha.active.forgot_email' => true, 'captcha.active.curated_register' => true, @@ -146,7 +146,7 @@ class CaptchaManagerTest extends TestCase $this->assertTrue($manager->activeOn('login')); $this->assertFalse($manager->activeOn('register')); - $this->assertTrue($manager->activeOn('forgotpassword')); + $this->assertTrue($manager->activeOn('forgot_password')); $this->assertFalse($manager->activeOn('password_reset')); $this->assertTrue($manager->activeOn('forgot_email')); $this->assertTrue($manager->activeOn('curated_register'));