mirror of
https://github.com/pelican-dev/panel.git
synced 2025-05-28 08:04:45 +02:00

* add laravel turnstile * add config & settings for turnstile * publish view to center captcha * completely replace reCAPTCHA * update FailedCaptcha event * add back config for domain verification * don't set language so browser lang is used
37 lines
1.1 KiB
PHP
37 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace App\Filament\Pages\Auth;
|
|
|
|
use Coderflex\FilamentTurnstile\Forms\Components\Turnstile;
|
|
use Filament\Pages\Auth\Login as BaseLogin;
|
|
|
|
class Login extends BaseLogin
|
|
{
|
|
protected function getForms(): array
|
|
{
|
|
return [
|
|
'form' => $this->form(
|
|
$this->makeForm()
|
|
->schema([
|
|
$this->getEmailFormComponent(),
|
|
$this->getPasswordFormComponent(),
|
|
$this->getRememberFormComponent(),
|
|
Turnstile::make('captcha')
|
|
->hidden(!config('turnstile.turnstile_enabled'))
|
|
->validationMessages([
|
|
'required' => config('turnstile.error_messages.turnstile_check_message'),
|
|
]),
|
|
])
|
|
->statePath('data'),
|
|
),
|
|
];
|
|
}
|
|
|
|
protected function throwFailureValidationException(): never
|
|
{
|
|
$this->dispatch('reset-captcha');
|
|
|
|
parent::throwFailureValidationException();
|
|
}
|
|
}
|