diff --git a/Tests/TokenExtractor/SplitCookieTokenExtractorTest.php b/Tests/TokenExtractor/SplitCookieTokenExtractorTest.php index e09f1099..3ee611a4 100644 --- a/Tests/TokenExtractor/SplitCookieTokenExtractorTest.php +++ b/Tests/TokenExtractor/SplitCookieTokenExtractorTest.php @@ -20,6 +20,10 @@ public function testGetTokenRequest() $request = new Request(); $this->assertFalse($extractor->extract($request)); + $request = new Request(); + $request->cookies->add(['jwt_s' => 'testsignature']); + $this->assertFalse($extractor->extract($request)); + $request = new Request(); $request->cookies->add(['jwt_hp' => 'testheader.testpayload']); $request->cookies->add(['jwt_s' => 'testsignature']); diff --git a/TokenExtractor/SplitCookieExtractor.php b/TokenExtractor/SplitCookieExtractor.php index f2bfff36..31db354e 100644 --- a/TokenExtractor/SplitCookieExtractor.php +++ b/TokenExtractor/SplitCookieExtractor.php @@ -35,7 +35,7 @@ public function extract(Request $request) $jwtCookies[] = $request->cookies->get($cookie, false); } - if (empty(array_filter($jwtCookies))) { + if (count($this->cookies) !== count(array_filter($jwtCookies))) { return false; }