Skip to content

Commit 39bdfc4

Browse files
Fix Flux OTP error rendering and accessibility (#161)
* fix: Show error when user enters invalid OTP code * Remove redundant classes --------- Co-authored-by: Pushpak Chhajed <[email protected]>
1 parent ca98417 commit 39bdfc4

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed

resources/views/livewire/auth/two-factor-challenge.blade.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class="relative w-full h-auto"
1414
this.recovery_code = '';
1515
1616
$dispatch('clear-2fa-auth-code');
17-
17+
1818
$nextTick(() => {
1919
this.showRecoveryInput
2020
? this.$refs.recovery_code?.focus()
@@ -43,7 +43,14 @@ class="relative w-full h-auto"
4343
<div class="space-y-5 text-center">
4444
<div x-show="!showRecoveryInput">
4545
<div class="flex items-center justify-center my-5">
46-
<flux:otp x-model="code" length="6" name="code" submit="auto" />
46+
<flux:otp
47+
x-model="code"
48+
length="6"
49+
name="code"
50+
label="OTP Code"
51+
label:sr-only
52+
class="mx-auto"
53+
/>
4754
</div>
4855
</div>
4956

resources/views/livewire/settings/two-factor.blade.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,8 +265,15 @@ class="max-w-md md:min-w-md"
265265

266266
@if ($showVerificationStep)
267267
<div class="space-y-6">
268-
<div class="flex flex-col items-center space-y-3">
269-
<flux:otp wire:model="code" length="6" submit="auto" />
268+
<div class="flex flex-col items-center space-y-3 justify-center">
269+
<flux:otp
270+
name="code"
271+
wire:model="code"
272+
length="6"
273+
label="OTP Code"
274+
label:sr-only
275+
class="mx-auto"
276+
/>
270277
</div>
271278

272279
<div class="flex items-center space-x-3">

0 commit comments

Comments
 (0)