aboutsummaryrefslogtreecommitdiffstats
path: root/apps/twofactor_backupcodes
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2023-11-14 08:49:17 +0100
committerJoas Schilling <coding@schilljs.com>2023-11-14 08:49:17 +0100
commitd1f3ab030b1895cc08850fa8f99eccede57a7d5b (patch)
treeaf86053a31f5c603d51ad30f820797b028405055 /apps/twofactor_backupcodes
parent6284009fa024005df591f2308fefc49e68728e49 (diff)
downloadnextcloud-server-d1f3ab030b1895cc08850fa8f99eccede57a7d5b.tar.gz
nextcloud-server-d1f3ab030b1895cc08850fa8f99eccede57a7d5b.zip
fix(backupcodes): Remove old notifications before creating a new reminder
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'apps/twofactor_backupcodes')
-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);
}
}