aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Controller/ConfigController.php
diff options
context:
space:
mode:
authorJeremy Benoist <jeremy.benoist@gmail.com>2018-12-03 06:51:06 +0100
committerJeremy Benoist <jeremy.benoist@gmail.com>2019-01-23 13:28:03 +0100
commitdfd0a7bc5feb4fd7b77d7e2f3a25c5c3febc1eba (patch)
tree112b4403052b0420804dc8a7bcba199f534d902e /src/Wallabag/CoreBundle/Controller/ConfigController.php
parent6e4fc956abc909232044e7af0fa37cbb1b510f18 (diff)
downloadwallabag-dfd0a7bc5feb4fd7b77d7e2f3a25c5c3febc1eba.tar.gz
wallabag-dfd0a7bc5feb4fd7b77d7e2f3a25c5c3febc1eba.tar.zst
wallabag-dfd0a7bc5feb4fd7b77d7e2f3a25c5c3febc1eba.zip
Add backup codes
Diffstat (limited to 'src/Wallabag/CoreBundle/Controller/ConfigController.php')
-rw-r--r--src/Wallabag/CoreBundle/Controller/ConfigController.php3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/Wallabag/CoreBundle/Controller/ConfigController.php b/src/Wallabag/CoreBundle/Controller/ConfigController.php
index 846e96ff..c9fc5702 100644
--- a/src/Wallabag/CoreBundle/Controller/ConfigController.php
+++ b/src/Wallabag/CoreBundle/Controller/ConfigController.php
@@ -2,6 +2,7 @@
2 2
3namespace Wallabag\CoreBundle\Controller; 3namespace Wallabag\CoreBundle\Controller;
4 4
5use PragmaRX\Recovery\Recovery as BackupCodes;
5use Symfony\Bundle\FrameworkBundle\Controller\Controller; 6use Symfony\Bundle\FrameworkBundle\Controller\Controller;
6use Symfony\Component\HttpFoundation\JsonResponse; 7use Symfony\Component\HttpFoundation\JsonResponse;
7use Symfony\Component\HttpFoundation\RedirectResponse; 8use Symfony\Component\HttpFoundation\RedirectResponse;
@@ -93,10 +94,12 @@ class ConfigController extends Controller
93 94
94 $user->setGoogleAuthenticatorSecret($secret); 95 $user->setGoogleAuthenticatorSecret($secret);
95 $user->setEmailTwoFactor(false); 96 $user->setEmailTwoFactor(false);
97 $user->setBackupCodes((new BackupCodes())->toArray());
96 98
97 $this->addFlash('OtpQrCode', $this->get('scheb_two_factor.security.google_authenticator')->getQRContent($user)); 99 $this->addFlash('OtpQrCode', $this->get('scheb_two_factor.security.google_authenticator')->getQRContent($user));
98 } elseif (false === $userForm->get('googleTwoFactor')->getData() && true === $user->isGoogleAuthenticatorEnabled()) { 100 } elseif (false === $userForm->get('googleTwoFactor')->getData() && true === $user->isGoogleAuthenticatorEnabled()) {
99 $user->setGoogleAuthenticatorSecret(null); 101 $user->setGoogleAuthenticatorSecret(null);
102 $user->setBackupCodes(null);
100 } 103 }
101 } 104 }
102 105