use Graby\SiteConfig\ConfigBuilder;
use Psr\Log\LoggerInterface;
use Wallabag\CoreBundle\Repository\SiteCredentialRepository;
use Graby\SiteConfig\ConfigBuilder;
use Psr\Log\LoggerInterface;
use Wallabag\CoreBundle\Repository\SiteCredentialRepository;
- public function __construct(ConfigBuilder $grabyConfigBuilder, User $currentUser, SiteCredentialRepository $credentialRepository, LoggerInterface $logger)
+ public function __construct(ConfigBuilder $grabyConfigBuilder, TokenStorage $token, SiteCredentialRepository $credentialRepository, LoggerInterface $logger)
{
$this->grabyConfigBuilder = $grabyConfigBuilder;
$this->credentialRepository = $credentialRepository;
{
$this->grabyConfigBuilder = $grabyConfigBuilder;
$this->credentialRepository = $credentialRepository;
- $credentials = $this->credentialRepository->findOneByHostAndUser($host, $this->currentUser->getId());
+ $credentials = null;
+ if ($this->currentUser) {
+ $credentials = $this->credentialRepository->findOneByHostAndUser($host, $this->currentUser->getId());
+ }
if (null === $credentials) {
$this->logger->debug('Auth: no credentials available for host.', ['host' => $host]);
if (null === $credentials) {
$this->logger->debug('Auth: no credentials available for host.', ['host' => $host]);