Fixed exception on user settings submission

This commit is contained in:
Jan Böhmer 2023-06-20 01:43:02 +02:00
parent 801ed0fbaf
commit 225da163bb

View file

@ -325,7 +325,7 @@ class UserSettingsController extends AbstractController
'disabled' => $this->demo_mode || $user->isSamlUser(),
]);
$google_enabled = $user->isGoogleAuthenticatorEnabled();
if (!$google_enabled && !$form->isSubmitted()) {
if (!$google_enabled && !$google_form->isSubmitted()) {
$user->setGoogleAuthenticatorSecret($googleAuthenticator->generateSecret());
$google_form->get('googleAuthenticatorSecret')->setData($user->getGoogleAuthenticatorSecret());
}