The package exposes a middleware that forces the user to have 2FA enabled. If the user don't, they are redirected to the filament 2FA settings page (based on webbingbrasil/filament-2fa).
You can add the middleware to a middleware group (such as filament's auth
group in config/filament.php
which will always affect logged-in users).
/*
|--------------------------------------------------------------------------
| Middleware
|--------------------------------------------------------------------------
|
| You may customise the middleware stack that Filament uses to handle
| requests.
|
*/
'middleware' => [
'auth' => [
// ...
\CloudMazing\FilamentForce2FA\Http\Middleware\Require2FA::class,
],
'base' => [
//...
],
],
Or you can use the middleware on individual endpoints by registering in the Kernel App\Http\Kernel
:
protected $routeMiddleware = [
//...
'2fa' => \CloudMazing\FilamentForce2FA\Http\Middleware\Require2FA::class,
];
Then when declaring routes:
Route::middleware('2fa')->get('/hello');
You can install the package via composer:
composer require cloudmazing/filament-force-2fa
You can publish and run the migrations with:
php artisan vendor:publish --tag="filament-force-2fa-migrations"
php artisan migrate
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.