Skip to content

Commit

Permalink
changes
Browse files Browse the repository at this point in the history
  • Loading branch information
oldrichpospisilik committed Nov 25, 2022
1 parent 68dce80 commit 8de820f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Admin/AdministratorPresenter.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public function createComponentNewForm(): Form
unset($values['account']);

$administrator = $this->getParameter('administrator');
$doNotRedirect = !$administrator->google2faSecret && $values['google2faSecret'];
$doNotRedirect = (!$administrator || !$administrator->google2faSecret) && $values['google2faSecret'];

$values['google2faSecret'] = $values['google2faSecret'] && $this->google2FA->isEnabled() ? $this->google2FA->generateSecretKey() : null;

Expand Down
4 changes: 2 additions & 2 deletions src/Bridges/AdminDI.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ public function getConfigSchema(): Schema
'prettyPages' => Expect::bool(false),
'serviceMode' => Expect::bool(false),
'adminGrid' => Expect::array([]),
'google2FA' => Expect::arrayOf(Expect::structure([
'google2FA' => Expect::structure([
'enabled' => Expect::bool(false),
'company' => Expect::string(['Admin']),
])),
]),
]);
}

Expand Down

0 comments on commit 8de820f

Please sign in to comment.