mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-03-06 15:30:13 +01:00
Fixed 2FA TOTP for non-admins, while also retaining validation of auth code
This fixes issue #717
This commit is contained in:
@@ -331,7 +331,7 @@ class UserSettingsController extends AbstractController
|
||||
$google_form->handleRequest($request);
|
||||
|
||||
//We do not need to check for validity of the google form here, because we do not care if the other fields are valid
|
||||
if (!$this->demo_mode && !$user->isSamlUser() && $google_form->isSubmitted()) {
|
||||
if (!$this->demo_mode && !$user->isSamlUser() && $google_form->isSubmitted() && $google_form->isValid()) {
|
||||
if (!$google_enabled) {
|
||||
//Save 2FA settings (save secrets)
|
||||
$user->setGoogleAuthenticatorSecret($google_form->get('googleAuthenticatorSecret')->getData());
|
||||
|
||||
Reference in New Issue
Block a user