diff --git a/app/Http/Controllers/Auth/LoginController.php b/app/Http/Controllers/Auth/LoginController.php index 6bcec3647..5a11808ce 100644 --- a/app/Http/Controllers/Auth/LoginController.php +++ b/app/Http/Controllers/Auth/LoginController.php @@ -70,7 +70,7 @@ class LoginController extends Controller 'password' => 'required|string|min:6', ]; - if(config('captcha.enabled')) { + if(config('captcha.enabled') || config('captcha.active.login')) { $rules['h-captcha-response'] = 'required|captcha'; } diff --git a/app/Http/Controllers/Auth/RegisterController.php b/app/Http/Controllers/Auth/RegisterController.php index 0e62abef8..b70f1d52a 100644 --- a/app/Http/Controllers/Auth/RegisterController.php +++ b/app/Http/Controllers/Auth/RegisterController.php @@ -137,7 +137,7 @@ class RegisterController extends Controller 'password' => 'required|string|min:'.config('pixelfed.min_password_length').'|confirmed', ]; - if(config('captcha.enabled')) { + if(config('captcha.enabled') || config('captcha.active.register')) { $rules['h-captcha-response'] = 'required|captcha'; } diff --git a/config/captcha.php b/config/captcha.php index baeeae2d2..4f55cbb1d 100644 --- a/config/captcha.php +++ b/config/captcha.php @@ -12,4 +12,9 @@ return [ 'attributes' => [ 'theme' => 'light' ], -]; \ No newline at end of file + + 'active' => [ + 'login' => env('CAPTCHA_ENABLED_ON_LOGIN', false), + 'register' => env('CAPTCHA_ENABLED_ON_REGISTER', false) + ] +]; diff --git a/resources/views/auth/login.blade.php b/resources/views/auth/login.blade.php index 19b241485..73559826e 100644 --- a/resources/views/auth/login.blade.php +++ b/resources/views/auth/login.blade.php @@ -50,7 +50,7 @@ - @if(config('captcha.enabled')) + @if(config('captcha.enabled') || config('captcha.active.login'))