fix(profile): remove redundant 2FA enabled badge

This commit is contained in:
Andras Bacsai
2026-08-11 12:18:35 +02:00
parent 1a8a4bb5ef
commit d64cbda3e8
2 changed files with 17 additions and 13 deletions
@@ -261,19 +261,16 @@
</div>
@elseif (request()->user()->two_factor_confirmed_at)
<div class="flex flex-col gap-4">
<div class="flex flex-wrap items-center justify-between gap-3">
<x-status-badge status="Enabled" type="success" />
<div class="flex flex-wrap items-center gap-2">
<form action="/user/two-factor-recovery-codes" method="POST">
@csrf
<x-forms.button type="submit">Regenerate recovery codes</x-forms.button>
</form>
<form action="/user/two-factor-authentication" method="POST">
@csrf
@method('DELETE')
<x-forms.button type="submit" isError>Disable 2FA</x-forms.button>
</form>
</div>
<div class="flex flex-wrap items-center justify-end gap-2">
<form action="/user/two-factor-recovery-codes" method="POST">
@csrf
<x-forms.button type="submit">Regenerate recovery codes</x-forms.button>
</form>
<form action="/user/two-factor-authentication" method="POST">
@csrf
@method('DELETE')
<x-forms.button type="submit" isError>Disable 2FA</x-forms.button>
</form>
</div>
@if (session('status') === 'two-factor-authentication-confirmed'
|| session('status') === 'recovery-codes-generated')
@@ -27,6 +27,13 @@ it('opens the email change form without a Livewire request', function () {
->not->toContain('wire:click="showEmailChangeForm"');
});
it('does not show a redundant enabled badge for two-factor authentication', function () {
$profileView = file_get_contents(resource_path('views/livewire/profile/index.blade.php'));
expect($profileView)
->not->toContain('<x-status-badge status="Enabled" type="success" />');
});
it('keeps color theme preferences on the profile appearance view without page width or density controls', function () {
$appearanceView = file_get_contents(resource_path('views/livewire/profile/appearance.blade.php'));