diff --git a/app/Livewire/Settings/Index.php b/app/Livewire/Settings/Index.php index 7adb0f8a7..3d90024b7 100644 --- a/app/Livewire/Settings/Index.php +++ b/app/Livewire/Settings/Index.php @@ -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; } } diff --git a/resources/views/livewire/settings/index.blade.php b/resources/views/livewire/settings/index.blade.php index 9b53b9be6..2bf2402a2 100644 --- a/resources/views/livewire/settings/index.blade.php +++ b/resources/views/livewire/settings/index.blade.php @@ -130,47 +130,30 @@

Confirmation Settings

-
- -
- @if ($disable_two_step_confirmation) -
- -
- @else -
- -
-
-

Warning!

-

Disabling two step confirmation reduces security (as anyone can easily delete anything) and - increases - the risk of accidental actions. This is not recommended for production servers.

-
- @endif + @if ($disable_two_step_confirmation) +
+
-
+ @else +
+ +
+
+

Warning!

+

Disabling two step confirmation reduces security (as anyone can easily delete anything) and + increases + the risk of accidental actions. This is not recommended for production servers.

+
+ @endif