summaryrefslogtreecommitdiffstats
path: root/apps/twofactor_backupcodes/lib
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2019-02-11 14:29:44 +0100
committerJoas Schilling <coding@schilljs.com>2019-02-11 15:32:34 +0100
commit01f4506dadec86373ee629771677f837cc2a4036 (patch)
tree6005e2777005030b87286d1f89e2f8ddfa36c2fa /apps/twofactor_backupcodes/lib
parent924e40a06b2428f0dae82f5f6756e398fd5c1521 (diff)
downloadnextcloud-server-01f4506dadec86373ee629771677f837cc2a4036.tar.gz
nextcloud-server-01f4506dadec86373ee629771677f837cc2a4036.zip
Add a link to the notification to create the backup codes
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'apps/twofactor_backupcodes/lib')
-rw-r--r--apps/twofactor_backupcodes/lib/Notifications/Notifier.php9
1 files changed, 8 insertions, 1 deletions
diff --git a/apps/twofactor_backupcodes/lib/Notifications/Notifier.php b/apps/twofactor_backupcodes/lib/Notifications/Notifier.php
index 3d5fedd93ea..df92c7a9e01 100644
--- a/apps/twofactor_backupcodes/lib/Notifications/Notifier.php
+++ b/apps/twofactor_backupcodes/lib/Notifications/Notifier.php
@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace OCA\TwoFactorBackupCodes\Notifications;
+use OCP\IURLGenerator;
use OCP\L10N\IFactory;
use OCP\Notification\INotification;
use OCP\Notification\INotifier;
@@ -33,8 +34,12 @@ class Notifier implements INotifier {
/** @var IFactory */
private $factory;
- public function __construct(IFactory $factory) {
+ /** @var IURLGenerator */
+ private $url;
+
+ public function __construct(IFactory $factory, IURLGenerator $url) {
$this->factory = $factory;
+ $this->url = $url;
}
public function prepare(INotification $notification, $languageCode) {
@@ -53,6 +58,8 @@ class Notifier implements INotifier {
)->setParsedMessage(
$l->t('You have enabled two-factor authentication but have not yet generated backup codes. Be sure to do this in case you lose access to your second factor.')
);
+
+ $notification->setLink($this->url->linkToRouteAbsolute('settings.PersonalSettings.index', ['section' => 'security']));
return $notification;
default: