Skip to content

Commit f0f19a2

Browse files
committed
Remove dependency to session service at VatriGoogleDriveAuthController
1 parent 9770e46 commit f0f19a2

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/Controller/VatriGoogleDriveAuthController.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace Vatri\GoogleDriveBundle\Controller;
44

55
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
6+
use Symfony\Component\HttpFoundation\RequestStack;
67
use Symfony\Component\Routing\Annotation\Route;
78
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface;
89
use Symfony\Component\HttpFoundation\Session\SessionInterface;
@@ -27,10 +28,12 @@ class VatriGoogleDriveAuthController extends AbstractController
2728
*/
2829
private $driveApiService;
2930

30-
public function __construct(ParameterBagInterface $parameterBag, SessionInterface $session, DriveApiService $driveApiService)
31+
public function __construct(ParameterBagInterface $parameterBag, RequestStack $requestSatck, DriveApiService $driveApiService)
3132
{
33+
try {
34+
$this->session = $requestStack->getSession();
35+
} catch (\Exception $exception){}
3236
$this->parameterBag = $parameterBag;
33-
$this->session = $session;
3437
$this->driveApiService = $driveApiService;
3538
}
3639
/**

src/Resources/config/vatri_google_drive.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,5 @@ services:
2626
autoconfigure: true
2727
arguments:
2828
$parameterBag: '@parameter_bag'
29-
$session: '@request_stack'
29+
$requestStack: '@request_stack'
3030
$driveApiService: '@vatri_google_drive.api_service'

0 commit comments

Comments
 (0)