core-bundle/src/Security/Authentication/Token/TokenChecker.php
public function hasFrontendUser(): bool
    {
        $token = $this->getToken(FrontendUser::SECURITY_SESSION_KEY);

        return null !== $token && $token->getUser() instanceof FrontendUser;
    }
public function hasFrontendUser(): bool
    {
        $token = $this->getToken(FrontendUser::SECURITY_SESSION_KEY);

        return null !== $token && $token->getUser() instanceof FrontendUser;
    }
Checks if a front end user is authenticated.