polish(auth): distinct backup page title, autocomplete off, empty-code test
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>feat/v1-foundation
parent
e8bbe21b78
commit
4e32f76d1b
|
|
@ -50,6 +50,6 @@ class TwoFactorBackup extends Component
|
||||||
|
|
||||||
public function render()
|
public function render()
|
||||||
{
|
{
|
||||||
return view('livewire.auth.two-factor-backup')->title(__('auth.title_challenge'));
|
return view('livewire.auth.two-factor-backup')->title(__('auth.title_backup'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -65,6 +65,7 @@ return [
|
||||||
'title_login' => 'Anmelden — Clusev',
|
'title_login' => 'Anmelden — Clusev',
|
||||||
'title_password_change' => 'Passwort ändern — Clusev',
|
'title_password_change' => 'Passwort ändern — Clusev',
|
||||||
'title_challenge' => 'Bestätigung — Clusev',
|
'title_challenge' => 'Bestätigung — Clusev',
|
||||||
|
'title_backup' => 'Backup-Code — Clusev',
|
||||||
'title_setup' => '2FA einrichten — Clusev',
|
'title_setup' => '2FA einrichten — Clusev',
|
||||||
|
|
||||||
// ── Validation / error messages ──────────────────────────────────────
|
// ── Validation / error messages ──────────────────────────────────────
|
||||||
|
|
|
||||||
|
|
@ -65,6 +65,7 @@ return [
|
||||||
'title_login' => 'Sign in — Clusev',
|
'title_login' => 'Sign in — Clusev',
|
||||||
'title_password_change' => 'Change password — Clusev',
|
'title_password_change' => 'Change password — Clusev',
|
||||||
'title_challenge' => 'Verification — Clusev',
|
'title_challenge' => 'Verification — Clusev',
|
||||||
|
'title_backup' => 'Backup code — Clusev',
|
||||||
'title_setup' => 'Set up 2FA — Clusev',
|
'title_setup' => 'Set up 2FA — Clusev',
|
||||||
|
|
||||||
// ── Validation / error messages ──────────────────────────────────────
|
// ── Validation / error messages ──────────────────────────────────────
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@
|
||||||
<form wire:submit="verify" class="space-y-4">
|
<form wire:submit="verify" class="space-y-4">
|
||||||
<div>
|
<div>
|
||||||
<label for="code" class="{{ $label }}">{{ __('auth.challenge_backup_label') }}</label>
|
<label for="code" class="{{ $label }}">{{ __('auth.challenge_backup_label') }}</label>
|
||||||
<input wire:model="code" id="code" inputmode="text" autocomplete="one-time-code" autofocus
|
<input wire:model="code" id="code" inputmode="text" autocomplete="off" autofocus
|
||||||
class="{{ $fieldText }}" placeholder="{{ __('auth.challenge_backup_placeholder') }}" />
|
class="{{ $fieldText }}" placeholder="{{ __('auth.challenge_backup_placeholder') }}" />
|
||||||
@error('code') <p class="{{ $err }}"><x-icon name="alert" class="h-3.5 w-3.5 shrink-0" />{{ $message }}</p> @enderror
|
@error('code') <p class="{{ $err }}"><x-icon name="alert" class="h-3.5 w-3.5 shrink-0" />{{ $message }}</p> @enderror
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -67,6 +67,20 @@ class TwoFactorBackupTest extends TestCase
|
||||||
$this->assertGuest();
|
$this->assertGuest();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function test_empty_code_is_rejected(): void
|
||||||
|
{
|
||||||
|
$user = $this->enrolledUser();
|
||||||
|
$user->replaceRecoveryCodes();
|
||||||
|
session()->put('2fa.user', $user->id);
|
||||||
|
|
||||||
|
Livewire::test(TwoFactorBackup::class)
|
||||||
|
->set('code', '')
|
||||||
|
->call('verify')
|
||||||
|
->assertHasErrors('code');
|
||||||
|
|
||||||
|
$this->assertGuest();
|
||||||
|
}
|
||||||
|
|
||||||
public function test_a_totp_code_is_not_accepted_on_the_backup_view(): void
|
public function test_a_totp_code_is_not_accepted_on_the_backup_view(): void
|
||||||
{
|
{
|
||||||
$user = $this->enrolledUser();
|
$user = $this->enrolledUser();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue