fix: ui bug on pw confirmation

This commit is contained in:
Andras Bacsai committed 2025-01-07 14:39:31 +01:00
1 parent 965d656c5b
commit c702ebff6d
2 files changed
+27 -42

No files matched your search

+4 -2
View File
@@ -226,16 +226,18 @@ class Index extends Component
}
}
public function toggleTwoStepConfirmation($password)
public function toggleTwoStepConfirmation($password): bool
{
if (! Hash::check($password, Auth::user()->password)) {
$this->addError('password', 'The provided password is incorrect.');
return;
return false;
}
$this->settings->disable_two_step_confirmation = $this->disable_two_step_confirmation = true;
$this->settings->save();
$this->dispatch('success', 'Two step confirmation has been disabled.');
return true;
}
}