fix password is now checked before a user can disable 2 step confirmation
This commit is contained in:
parent
ff60189285
commit
d2066dd2dc
1 changed files with 9 additions and 1 deletions
|
|
@ -5,6 +5,8 @@
|
|||
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 @@ public function render()
|
|||
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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue