Skip to content

Commit 3e12ddf

Browse files
committed
Fix: Confirm not autosubmitting
1 parent 4e196df commit 3e12ddf

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

src/Livewire/Confirm2Fa.php

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,9 @@ class Confirm2Fa extends SimplePage implements HasForms
2727

2828
protected static string $view = 'filament-2fa::livewire.confirm2-fa';
2929

30-
public static function canView()
31-
{
32-
return false;
33-
}
30+
public bool $safe_device_enable = true;
3431

35-
public function hasTopbar(): bool
36-
{
37-
return false;
38-
}
32+
public string $totp_code;
3933

4034
public function mount()
4135
{
@@ -145,14 +139,14 @@ protected function get2FaFormComponent(): Component
145139
->extraInputAttributes(['class'=>'text-center','style'=>'font-size:2.6em; letter-spacing:1rem'])
146140
->live()
147141
->afterStateUpdated(function ($state) {
148-
$requiredLength = config('two-factor.totp.digits');
149-
if (strlen($state) == $requiredLength) {
142+
if (strlen($state) === config('two-factor.totp.digits')) {
150143
$this->submit();
151144
}
152145
}),
153146
Toggle::make('safe_device_enable')
154147
->label(__('filament-2fa::two-factor.enable_safe_device',['days' => config('two-factor.safe_devices.expiration_days')]))
155148
->hintIcon('heroicon-o-information-circle',__('filament-2fa::two-factor.safe_device_hint'))
149+
->hintColor('info')
156150
->inline()
157151
->onColor('success')
158152
->offColor('danger')

0 commit comments

Comments
 (0)