From 5681770ebcc91f1ee9855152eb4068aa7f15f782 Mon Sep 17 00:00:00 2001 From: Baspa Date: Thu, 19 Sep 2024 21:05:02 +0200 Subject: [PATCH] [Fix] Only show deactive notification when actually deactivated --- src/Pages/TwoFactor.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/Pages/TwoFactor.php b/src/Pages/TwoFactor.php index c503e2c..90b67ce 100644 --- a/src/Pages/TwoFactor.php +++ b/src/Pages/TwoFactor.php @@ -275,12 +275,14 @@ public function disableTwoFactorAuthentication(DisableTwoFactorAuthentication $d { $disable($this->user); - Notification::make() - ->title(__('Two-Factor Authentication deactivated')) - ->body(__('You can now log in without a code.')) - ->success() - ->duration(5000) - ->send(); + if ($this->user->two_factor_confirmed_at) { + Notification::make() + ->title(__('Two-Factor Authentication deactivated')) + ->body(__('You can now log in without a code.')) + ->success() + ->duration(5000) + ->send(); + } $this->showingQrCode = false; $this->showingConfirmation = false;