-
-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace reCAPTCHA with Turnstile (#589)
* 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
- Loading branch information
Showing
17 changed files
with
372 additions
and
136 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?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(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.