Simplifies adding a secure password confirmation step to your admin panels.
You can install the package via composer:
composer require juliomotol/filament-password-confirmation
Then add the plugin to your panel.
JulioMotol\FilamentPasswordConfirmation\FilamentPasswordConfirmationPlugin; public function panel(Panel $panel): Panel{ return $panel ->plugin(FilamentPasswordConfirmationPlugin::make());}
You can configure the route name, uri, middleware and password timeout duration.
FilamentPasswordConfirmationPlugin::make() ->routeName('confirm') ->routeUri('auth/confirm') ->routeMiddleware(FooMiddleware::class) // Accepts string|array ->passwordTimeout(10800) // Accepts int|null that represents the amount of seconds
Optionally, you can publish the translations and views using.
php artisan vendor:publish --tag="filament-password-confirmation-translations"php artisan vendor:publish --tag="filament-password-confirmation-views"
Simply use RequiresPasswordConfirmation
in your pages/resources.
use JulioMotol\FilamentPasswordConfirmation\RequiresPasswordConfirmation; class AdminResource extends Resource{ use RequiresPasswordConfirmation; ...}
You can configure the password confirmation timeout within your page/resource.
use JulioMotol\FilamentPasswordConfirmation\RequiresPasswordConfirmation; class AdminResource extends Resource{ use RequiresPasswordConfirmation; protected static ?int $passwordTimeout = 360; // the amount of seconds ...}
NOTE: The password timeout duration is determined in the following order until it encounters a non-null value.
$passwordTimeout
property in the page/resourcepasswordTimeout()
configured in the plugin during registryauth.password_timeout
config assigned inconfig/auth.php
composer test
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
Please review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see License File for more information.