Skip to content

Commit

Permalink
[Fix] Only show deactive notification when actually deactivated
Browse files Browse the repository at this point in the history
  • Loading branch information
Baspa committed Sep 19, 2024
1 parent c2757d5 commit 5681770
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/Pages/TwoFactor.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 5681770

Please sign in to comment.