Fix FLEXIAPI-154 Fix and improve hcaptcha integration

This commit is contained in:
Timothée Jaussoin 2024-03-21 13:42:53 +00:00
parent 9d7618e9c4
commit 92e06df01f
4 changed files with 7 additions and 7 deletions

View file

@ -50,10 +50,10 @@ class AccountController extends Controller
public function store(CreateAccountRequest $request)
{
$account = (new AccountService(api: false))->store($request);
$request->validate(['h-captcha-response' => captchaConfigured() ? 'required|HCaptcha' : '']);
$account = (new AccountService(api: false))->store($request);
Auth::login($account);
if ($request->has('phone')) {

View file

@ -34,12 +34,12 @@
</div>
<div>
<input required="" name="password" type="password" value="" placeholder="Password">
<input required="" name="password" type="password" value="{{ old('password') }}" placeholder="Password">
<label for="password">Password</label>
@include('parts.errors', ['name' => 'password'])
</div>
<div>
<input required="" name="password_confirmation" type="password" value="" placeholder="Password confirmation">
<input required="" name="password_confirmation" type="password" value="{{ old('password_confirmation') }}" placeholder="Password confirmation">
<label for="password_confirmation">Confirm password</label>
@include('parts.errors', ['name' => 'password_confirmation'])
</div>

View file

@ -56,7 +56,7 @@
<tbody>
@foreach ($account->phoneChangeCodes as $phoneChangeCode)
<tr @if ($phoneChangeCode->consumed()) class="disabled crossed" @endif>
<td>{{ $phoneChangeCode->phone }}<td>
<td>{{ $phoneChangeCode->phone }}</td>
<td>
{{ $phoneChangeCode->created_at }}
</td>

View file

@ -1,6 +1,6 @@
@if (captchaConfigured())
<div class="large">
{!! HCaptcha::renderJs() !!}
<script src="https://hcaptcha.com/1/api.js?recaptchacompat=off" async="" defer=""></script>
{!! HCaptcha::display() !!}
@include('parts.errors', ['name' => 'h-captcha-response'])
</div>