File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -83,7 +83,7 @@ public function onKernelRequest(GetResponseEvent $event)
83
83
84
84
$ token = $ this ->tokenStorage ->getToken ();
85
85
86
- if (null !== $ token && $ this ->authorizationChecker ->isGranted (AuthenticatedVoter::IS_AUTHENTICATED_REMEMBERED )) {
86
+ if (null !== $ token && $ token -> isAuthenticated () && $ this ->authorizationChecker ->isGranted (AuthenticatedVoter::IS_AUTHENTICATED_REMEMBERED )) {
87
87
$ this ->setUserValue ($ token ->getUser ());
88
88
89
89
$ contextEvent = new SentryUserContextEvent ($ token );
Original file line number Diff line number Diff line change @@ -260,6 +260,11 @@ public function test_that_username_is_set_from_user_interface_if_token_present_a
260
260
->willReturn ($ user )
261
261
;
262
262
263
+ $ mockToken
264
+ ->method ('isAuthenticated ' )
265
+ ->willReturn (true )
266
+ ;
267
+
263
268
$ mockEvent = $ this ->createMock (GetResponseEvent::class);
264
269
265
270
$ mockEvent
@@ -311,6 +316,11 @@ public function test_that_username_is_set_from_user_interface_if_token_present_a
311
316
->willReturn ('some_user ' )
312
317
;
313
318
319
+ $ mockToken
320
+ ->method ('isAuthenticated ' )
321
+ ->willReturn (true )
322
+ ;
323
+
314
324
$ mockEvent = $ this ->createMock (GetResponseEvent::class);
315
325
316
326
$ mockEvent
@@ -370,6 +380,11 @@ public function test_that_username_is_set_from_user_interface_if_token_present_a
370
380
->willReturn ($ mockUser )
371
381
;
372
382
383
+ $ mockToken
384
+ ->method ('isAuthenticated ' )
385
+ ->willReturn (true )
386
+ ;
387
+
373
388
$ mockEvent = $ this ->createMock (GetResponseEvent::class);
374
389
375
390
$ mockEvent
You can’t perform that action at this time.
0 commit comments