Skip to content

Commit

Permalink
Fix 2fa redirect not being triggered on login (#756)
Browse files Browse the repository at this point in the history
  • Loading branch information
e-five256 committed May 2, 2024
1 parent c2bfcba commit 69cf373
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Security/Voter/PrivateInstanceVoter.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

use App\Entity\User;
use App\Service\SettingsManager;
use Scheb\TwoFactorBundle\Security\Authentication\Token\TwoFactorTokenInterface;
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
use Symfony\Component\Security\Core\Authorization\Voter\Voter;

Expand All @@ -22,6 +23,10 @@ protected function supports(string $attribute, $subject): bool

protected function voteOnAttribute(string $attribute, $subject, TokenInterface $token): bool
{
if ($token instanceof TwoFactorTokenInterface) {
return false;
}

if ($this->settingsManager->get('MBIN_PRIVATE_INSTANCE')) {
$user = $token->getUser();

Expand Down

0 comments on commit 69cf373

Please sign in to comment.