Closed
Description
Symfony version(s) affected: 5.1.2
Description
When user successfully logged in and restart browser (closed the browser tab and browser). Later when open browser and visit any page. Site throws error as follows:
Call to a member function getUser() on null.
From:
symfony\security-http\Authenticator\RememberMeAuthenticator.php (line 76)
Code: (At the time of my error)
public function authenticate(Request $request): PassportInterface
{
$token = $this->rememberMeServices->autoLogin($request);
return new SelfValidatingPassport($token->getUser());
}
How to reproduce
-
- Symfony 5.1.2 login with remember-me checkbox.
-
- Close browser tab and close browser.
-
- Open browser and go to any page.
Possible Solution
I'm not sure about this, but #37504. will help, i think so.
Here, when logout token checking is removed (else throws error when logout. #37510). Url /logout works fine.