From 8284cdfb02e7fa35c1597345cd98fa6bc3024c18 Mon Sep 17 00:00:00 2001 From: peaklabs-dev <122374094+peaklabs-dev@users.noreply.github.com> Date: Thu, 17 Oct 2024 12:23:13 +0200 Subject: [PATCH] add password confirmation to disable two step confirmation --- app/Livewire/Settings/Index.php | 9 ++++++++- .../views/livewire/settings/index.blade.php | 16 +++++++++++++++- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/app/Livewire/Settings/Index.php b/app/Livewire/Settings/Index.php index 7d3fe62a7..0636e592e 100644 --- a/app/Livewire/Settings/Index.php +++ b/app/Livewire/Settings/Index.php @@ -152,7 +152,6 @@ class Index extends Component $this->settings->is_api_enabled = $this->is_api_enabled; $this->settings->auto_update_frequency = $this->auto_update_frequency; $this->settings->update_check_frequency = $this->update_check_frequency; - $this->settings->disable_two_step_confirmation = $this->disable_two_step_confirmation; $this->settings->save(); $this->server->setupDynamicProxyConfiguration(); if (! $error_show) { @@ -186,4 +185,12 @@ class Index extends Component { return view('livewire.settings.index'); } + + public function toggleTwoStepConfirmation() + { + $this->settings->disable_two_step_confirmation = true; + $this->settings->save(); + $this->disable_two_step_confirmation = true; + $this->dispatch('success', 'Two step confirmation has been disabled.'); + } } diff --git a/resources/views/livewire/settings/index.blade.php b/resources/views/livewire/settings/index.blade.php index db2a06995..b8874cbac 100644 --- a/resources/views/livewire/settings/index.blade.php +++ b/resources/views/livewire/settings/index.blade.php @@ -111,7 +111,21 @@

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.

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