Skip to content

Commit

Permalink
accept all types
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinpapst committed Apr 19, 2024
1 parent 79d6236 commit 5ca1bce
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
namespace Scheb\TwoFactorBundle\Security\Authorization\Voter;

use Scheb\TwoFactorBundle\Security\Authentication\Token\TwoFactorTokenInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
use Symfony\Component\Security\Core\Authorization\Voter\AuthenticatedVoter;
use Symfony\Component\Security\Core\Authorization\Voter\CacheableVoterInterface;
Expand Down Expand Up @@ -47,6 +46,6 @@ public function supportsAttribute(string $attribute): bool

public function supportsType(string $subjectType): bool
{
return $subjectType === 'null' || $subjectType === Request::class;
return true;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,11 @@ public function supports_type(string $checkType, bool $expectedResult): void
public static function provideTypesForSupportCheck(): array
{
return [
[UserInterface::class, false],
['any', false],
['int', false],
['array', false],
['string', false],
[UserInterface::class, true],
['any', true],
['int', true],
['array', true],
['string', true],
['null', true],
[Request::class, true],
];
Expand Down

0 comments on commit 5ca1bce

Please sign in to comment.