From 67cb3d4816562f5d1f22f096fd39c2fc9877b7db Mon Sep 17 00:00:00 2001 From: Lance Pioch Date: Sat, 1 Jun 2024 12:49:36 -0400 Subject: [PATCH] Show backup tokens better --- .../Resources/UserResource/Pages/EditProfile.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/app/Filament/Resources/UserResource/Pages/EditProfile.php b/app/Filament/Resources/UserResource/Pages/EditProfile.php index 5f56f8fa4..c047b3262 100644 --- a/app/Filament/Resources/UserResource/Pages/EditProfile.php +++ b/app/Filament/Resources/UserResource/Pages/EditProfile.php @@ -22,6 +22,7 @@ use Filament\Forms\Components\Select; use Filament\Forms\Components\Tabs; use Filament\Forms\Components\TagsInput; use Filament\Forms\Components\Tabs\Tab; +use Filament\Forms\Components\Textarea; use Filament\Forms\Components\TextInput; use Filament\Forms\Get; use Filament\Notifications\Notification; @@ -104,10 +105,12 @@ class EditProfile extends \Filament\Pages\Auth\EditProfile return [ Placeholder::make('2fa-already-enabled') ->label('Two Factor Authentication is currently enabled!'), - Placeholder::make('backup-tokens') + Textarea::make('backup-tokens') ->hidden(fn () => !cache()->get("users.{$this->getUser()->id}.2fa.tokens")) - ->helperText(cache()->get("users.{$this->getUser()->id}.2fa.tokens") . - ' - these will not be shown again!') + ->rows(10) + ->readOnly() + ->formatStateUsing(fn () => cache()->get("users.{$this->getUser()->id}.2fa.tokens")) + ->helperText('These will not be shown again!') ->label('Backup Tokens:'), TextInput::make('2fa-disable-code') ->label('Disable 2FA')