Skip to content

Commit

Permalink
Change isAllowed method
Browse files Browse the repository at this point in the history
  • Loading branch information
mattamon committed Mar 1, 2024
1 parent 4753c71 commit 21e20f6
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/Service/SecurityService.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,7 @@ public function authenticateUser(Create $token): PasswordAuthenticatedUserInterf

public function isAllowed(string $token): bool
{
$userIds = $this->tmpStoreResolver->getIdsByTag($token);
if(count($userIds) === 0 || count($userIds) > 1) {
return false;
}
$entry = $this->tmpStoreResolver->get($userIds[0]);
return $entry && $entry->getTag() === $token;
$entry = $this->tmpStoreResolver->get($token);
return $entry !== null && $entry->getId() === $token;
}
}

0 comments on commit 21e20f6

Please sign in to comment.