pull/7309/head
Your Name 1 week ago
parent 40fc084167
commit afe2bb6d1d

@ -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'),

@ -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.';

@ -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'),

@ -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
{

@ -521,11 +521,11 @@
<div class="custom-control custom-checkbox">
<input
type="checkbox"
name="captcha_on_forgotpassword"
name="captcha_on_forgot_password"
class="custom-control-input"
id="captcha_on_forgotpassword"
v-model="platform.captcha_on_forgotpassword">
<label class="custom-control-label font-weight-bold" for="captcha_on_forgotpassword">Forgot Password Captcha</label>
id="captcha_on_forgot_password"
v-model="platform.captcha_on_forgot_password">
<label class="custom-control-label font-weight-bold" for="captcha_on_forgot_password">Forgot Password Captcha</label>
</div>
</div>
<div class="col-12 col-lg-6">
@ -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,

@ -54,7 +54,7 @@
</div>
</div>
<x-captcha surface="forgotpassword" theme="dark" :label="true" :show-error="true" wrapperClass="d-flex flex-grow-1" />
<x-captcha surface="forgot_password" theme="dark" :label="true" :show-error="true" wrapperClass="d-flex flex-grow-1" />
<div class="form-group row pt-4 mb-0">
<div class="col-md-12">

@ -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. */

@ -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'));

Loading…
Cancel
Save