Merge pull request #4408 from pixelfed/staging

Update login/register views and captcha config, enable login or regis…
This commit is contained in:
daniel 2023-05-23 03:54:25 -06:00 committed by GitHub
commit 9d763bded1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 11 additions and 5 deletions

View file

@ -52,6 +52,7 @@
- Update MediaController, add fallback for local files that are later stored on S3 but still are referenced in cached objects remotely ([4973cb46](https://github.com/pixelfed/pixelfed/commit/4973cb46)) - Update MediaController, add fallback for local files that are later stored on S3 but still are referenced in cached objects remotely ([4973cb46](https://github.com/pixelfed/pixelfed/commit/4973cb46))
- Update PublicTimelineService, improve warmCache query ([9f901d65](https://github.com/pixelfed/pixelfed/commit/9f901d65)) - Update PublicTimelineService, improve warmCache query ([9f901d65](https://github.com/pixelfed/pixelfed/commit/9f901d65))
- Update AP Inbox, fix delete handling ([2800c888](https://github.com/pixelfed/pixelfed/commit/2800c888)) - Update AP Inbox, fix delete handling ([2800c888](https://github.com/pixelfed/pixelfed/commit/2800c888))
- Update login/register views and captcha config, enable login or register captchas or both ([c071c719](https://github.com/pixelfed/pixelfed/commit/c071c719))
- ([](https://github.com/pixelfed/pixelfed/commit/)) - ([](https://github.com/pixelfed/pixelfed/commit/))
## [v0.11.6 (2023-05-03)](https://github.com/pixelfed/pixelfed/compare/v0.11.5...v0.11.6) ## [v0.11.6 (2023-05-03)](https://github.com/pixelfed/pixelfed/compare/v0.11.5...v0.11.6)

View file

@ -70,7 +70,7 @@ class LoginController extends Controller
'password' => 'required|string|min:6', 'password' => 'required|string|min:6',
]; ];
if(config('captcha.enabled')) { if(config('captcha.enabled') || config('captcha.active.login')) {
$rules['h-captcha-response'] = 'required|captcha'; $rules['h-captcha-response'] = 'required|captcha';
} }

View file

@ -137,7 +137,7 @@ class RegisterController extends Controller
'password' => 'required|string|min:'.config('pixelfed.min_password_length').'|confirmed', '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'; $rules['h-captcha-response'] = 'required|captcha';
} }

View file

@ -12,4 +12,9 @@ return [
'attributes' => [ 'attributes' => [
'theme' => 'light' 'theme' => 'light'
], ],
];
'active' => [
'login' => env('CAPTCHA_ENABLED_ON_LOGIN', false),
'register' => env('CAPTCHA_ENABLED_ON_REGISTER', false)
]
];

View file

@ -50,7 +50,7 @@
</div> </div>
</div> </div>
@if(config('captcha.enabled')) @if(config('captcha.enabled') || config('captcha.active.login'))
<div class="d-flex justify-content-center mb-3"> <div class="d-flex justify-content-center mb-3">
{!! Captcha::display() !!} {!! Captcha::display() !!}
</div> </div>

View file

@ -81,7 +81,7 @@
</div> </div>
</div> </div>
@if(config('captcha.enabled')) @if(config('captcha.enabled') || config('captcha.active.register'))
<div class="d-flex justify-content-center my-3"> <div class="d-flex justify-content-center my-3">
{!! Captcha::display() !!} {!! Captcha::display() !!}
</div> </div>