Skip to content

Commit a593ac8

Browse files
committed
Refactor and move some listener tests
1 parent 19c3410 commit a593ac8

File tree

3 files changed

+209
-395
lines changed

3 files changed

+209
-395
lines changed

src/EventListener/RequestListener.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,15 @@ public function onKernelRequest(GetResponseEvent $event): void
5353
return;
5454
}
5555

56-
if (null === $this->tokenStorage || null === $this->authorizationChecker) {
57-
return;
58-
}
56+
$token = null;
5957

60-
$token = $this->tokenStorage->getToken();
58+
if ($this->tokenStorage instanceof TokenStorageInterface) {
59+
$token = $this->tokenStorage->getToken();
60+
}
6161

6262
if (
6363
null !== $token
64+
&& null !== $this->authorizationChecker
6465
&& $token->isAuthenticated()
6566
&& $this->authorizationChecker->isGranted(AuthenticatedVoter::IS_AUTHENTICATED_REMEMBERED)
6667
) {

0 commit comments

Comments
 (0)