diff options
Diffstat (limited to 'src/Wallabag/CoreBundle/Controller/ConfigController.php')
-rw-r--r-- | src/Wallabag/CoreBundle/Controller/ConfigController.php | 3 |
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 | ||
3 | namespace Wallabag\CoreBundle\Controller; | 3 | namespace Wallabag\CoreBundle\Controller; |
4 | 4 | ||
5 | use PragmaRX\Recovery\Recovery as BackupCodes; | ||
5 | use Symfony\Bundle\FrameworkBundle\Controller\Controller; | 6 | use Symfony\Bundle\FrameworkBundle\Controller\Controller; |
6 | use Symfony\Component\HttpFoundation\JsonResponse; | 7 | use Symfony\Component\HttpFoundation\JsonResponse; |
7 | use Symfony\Component\HttpFoundation\RedirectResponse; | 8 | use 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 | ||