mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-25 15:55:22 +00:00
Update login/register views and captcha config, enable login or register captchas or both
This commit is contained in:
parent
39a42c637f
commit
c071c7195e
5 changed files with 10 additions and 5 deletions
|
@ -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';
|
||||
}
|
||||
|
||||
|
|
|
@ -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';
|
||||
}
|
||||
|
||||
|
|
|
@ -12,4 +12,9 @@ return [
|
|||
'attributes' => [
|
||||
'theme' => 'light'
|
||||
],
|
||||
];
|
||||
|
||||
'active' => [
|
||||
'login' => env('CAPTCHA_ENABLED_ON_LOGIN', false),
|
||||
'register' => env('CAPTCHA_ENABLED_ON_REGISTER', false)
|
||||
]
|
||||
];
|
||||
|
|
|
@ -50,7 +50,7 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
@if(config('captcha.enabled'))
|
||||
@if(config('captcha.enabled') || config('captcha.active.login'))
|
||||
<div class="d-flex justify-content-center mb-3">
|
||||
{!! Captcha::display() !!}
|
||||
</div>
|
||||
|
|
|
@ -81,7 +81,7 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
@if(config('captcha.enabled'))
|
||||
@if(config('captcha.enabled') || config('captcha.active.register'))
|
||||
<div class="d-flex justify-content-center my-3">
|
||||
{!! Captcha::display() !!}
|
||||
</div>
|
||||
|
|
Loading…
Reference in a new issue