Reset TwoFactorAuthentication
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
namespace App\Filament\Resources\UserResource\Pages;
|
||||
|
||||
use App\Filament\Resources\UserResource;
|
||||
use Filament\Notifications\Notification;
|
||||
use Filament\Pages\Actions;
|
||||
use Filament\Resources\Pages\EditRecord;
|
||||
|
||||
@@ -13,6 +14,19 @@ class EditUser extends EditRecord
|
||||
protected function getActions(): array
|
||||
{
|
||||
return [
|
||||
Actions\Action::make('two_factor_authentication')
|
||||
->label(__('Disable two-factor authentication'))
|
||||
->color('secondary')
|
||||
->action(function () {
|
||||
$this->record->disableTwoFactorAuth();
|
||||
|
||||
Notification::make()
|
||||
->body(__('Two-factor authentication disabled'))
|
||||
->success()
|
||||
->send();
|
||||
})
|
||||
->visible(fn () => $this->record->hasTwoFactorEnabled())
|
||||
->requiresConfirmation(),
|
||||
Actions\DeleteAction::make(),
|
||||
];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user