Skip to content

Commit 6e474fc

Browse files
committed
fix: Show error when user enters invalid OTP code
1 parent ca98417 commit 6e474fc

File tree

2 files changed

+19
-3
lines changed

2 files changed

+19
-3
lines changed

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

Lines changed: 11 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,16 @@ 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+
error:class="text-center"
53+
class="mx-auto"
54+
submit="auto"
55+
/>
4756
</div>
4857
</div>
4958

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,14 @@ class="max-w-md md:min-w-md"
266266
@if ($showVerificationStep)
267267
<div class="space-y-6">
268268
<div class="flex flex-col items-center space-y-3">
269-
<flux:otp wire:model="code" length="6" submit="auto" />
269+
<flux:otp
270+
wire:model="code"
271+
length="6"
272+
label="OTP Code"
273+
label:sr-only
274+
error:class="text-center"
275+
class="mx-auto"
276+
/>
270277
</div>
271278

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

0 commit comments

Comments
 (0)