Skip to content

Commit 0d27f34

Browse files
Merge branch '4.4' into 5.0
* 4.4: [Debug] fix ClassNotFoundFatalErrorHandler [Routing] Fix using a custom matcher & generator dumper class [Serializer] Fix cache in MetadataAwareNameConverter [Dotenv] Fixed infinite loop with missing quote followed by quoted value [HttpClient] Added missing sprintf [TwigBridge] button_widget now has its title attr translated even if its label = null or false [PhpUnitBridge] When using phpenv + phpenv-composer plugin, composer executable is wrapped into a bash script [Messenger] Added check if json_encode succeeded [Messenger] Added check if json_encode succeeded [FrameworkBundle][ContainerLintCommand] Only skip .errored. services [HttpClient] fix exception in case of PSR17 discovery failure [DependencyInjection] Handle ServiceClosureArgument for callable in container linting fix processing chain adapter based cache pool [HttpKernel] release lock explicitly [Security] Prevent canceled remember-me cookie from being accepted [FrameworkBundle][TranslationUpdateCommand] Do not output positive feedback on stderr [Security\Guard] Fix missing typehints do not render preferred choices as selected
2 parents 8dcc932 + 9f13322 commit 0d27f34

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

RememberMe/AbstractRememberMeServices.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,10 @@ public function getSecret()
9494
*/
9595
final public function autoLogin(Request $request): ?TokenInterface
9696
{
97+
if (($cookie = $request->attributes->get(self::COOKIE_ATTR_NAME)) && null === $cookie->getValue()) {
98+
return null;
99+
}
100+
97101
if (null === $cookie = $request->cookies->get($this->options['name'])) {
98102
return null;
99103
}

Tests/RememberMe/AbstractRememberMeServicesTest.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,17 @@ public function testAutoLoginReturnsNullWhenNoCookie()
3939
$this->assertNull($service->autoLogin(new Request()));
4040
}
4141

42+
public function testAutoLoginReturnsNullAfterLoginFail()
43+
{
44+
$service = $this->getService(null, ['name' => 'foo', 'path' => null, 'domain' => null]);
45+
46+
$request = new Request();
47+
$request->cookies->set('foo', 'foo');
48+
49+
$service->loginFail($request);
50+
$this->assertNull($service->autoLogin($request));
51+
}
52+
4253
public function testAutoLoginThrowsExceptionWhenImplementationDoesNotReturnUserInterface()
4354
{
4455
$this->expectException('RuntimeException');

0 commit comments

Comments
 (0)