Immediately show the new status after the google 2fa was enabled/disabled sucessfully.

This commit is contained in:
Jan Böhmer 2019-12-26 12:53:54 +01:00
parent 8add8c919d
commit 44fe58c587

View file

@ -254,11 +254,13 @@ class UserController extends AdminPages\BaseAdminController
$user->setGoogleAuthenticatorSecret($google_form->get('googleAuthenticatorSecret')->getData()); $user->setGoogleAuthenticatorSecret($google_form->get('googleAuthenticatorSecret')->getData());
$em->flush(); $em->flush();
$this->addFlash('success', 'user.settings.2fa.google.activated'); $this->addFlash('success', 'user.settings.2fa.google.activated');
return $this->redirectToRoute('user_settings');
} elseif ($google_enabled) { } elseif ($google_enabled) {
//Remove secret to disable google authenticator //Remove secret to disable google authenticator
$user->setGoogleAuthenticatorSecret(null); $user->setGoogleAuthenticatorSecret(null);
$em->flush(); $em->flush();
$this->addFlash('success', 'user.settings.2fa.google.disabled'); $this->addFlash('success', 'user.settings.2fa.google.disabled');
return $this->redirectToRoute('user_settings');
} }
} }