Merge pull request #4007 from coollabsio/fix-2-step-deletion

Fix 2 step deletion
This commit is contained in:
Andras Bacsai
2024-10-25 09:46:40 +02:00
committed by GitHub
11 changed files with 19 additions and 11 deletions

View File

@@ -5,6 +5,8 @@ namespace App\Livewire\Settings;
use App\Jobs\CheckForUpdatesJob;
use App\Models\InstanceSettings;
use App\Models\Server;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Hash;
use Livewire\Component;
class Index extends Component
@@ -185,8 +187,14 @@ class Index extends Component
return view('livewire.settings.index');
}
public function toggleTwoStepConfirmation()
public function toggleTwoStepConfirmation($password)
{
if (! Hash::check($password, Auth::user()->password)) {
$this->addError('password', 'The provided password is incorrect.');
return;
}
$this->settings->disable_two_step_confirmation = true;
$this->settings->save();
$this->disable_two_step_confirmation = true;