aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2023-11-14 08:49:17 +0100
committerbackportbot-nextcloud[bot] <backportbot-nextcloud[bot]@users.noreply.github.com>2023-11-14 10:11:08 +0000
commitd0bd69a46475b53fd8dd3084fe5dd3889606b82e (patch)
tree6bb55a7054dee12b855fd8881171caa5815b8647 /apps
parent69186f6927a626b72f0e1abe85e7c85389ef62a2 (diff)
downloadnextcloud-server-d0bd69a46475b53fd8dd3084fe5dd3889606b82e.tar.gz
nextcloud-server-d0bd69a46475b53fd8dd3084fe5dd3889606b82e.zip
fix(backupcodes): Remove old notifications before creating a new reminder
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'apps')
-rw-r--r--apps/twofactor_backupcodes/lib/BackgroundJob/RememberBackupCodesJob.php4
1 files changed, 3 insertions, 1 deletions
diff --git a/apps/twofactor_backupcodes/lib/BackgroundJob/RememberBackupCodesJob.php b/apps/twofactor_backupcodes/lib/BackgroundJob/RememberBackupCodesJob.php
index 3eed1bb8dea..592d8dab00c 100644
--- a/apps/twofactor_backupcodes/lib/BackgroundJob/RememberBackupCodesJob.php
+++ b/apps/twofactor_backupcodes/lib/BackgroundJob/RememberBackupCodesJob.php
@@ -94,9 +94,11 @@ class RememberBackupCodesJob extends TimedJob {
$notification = $this->notificationManager->createNotification();
$notification->setApp('twofactor_backupcodes')
->setUser($user->getUID())
- ->setDateTime($date)
->setObject('create', 'codes')
->setSubject('create_backupcodes');
+ $this->notificationManager->markProcessed($notification);
+
+ $notification->setDateTime($date);
$this->notificationManager->notify($notification);
}
}