Skip to content

Error: Remember-me user when reopens browser - Call to a member function getUser() on null. #37534

@featuriz

Description

@featuriz

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy