From 741cdfe32a8529ef11e24ddccafd0013289c56e5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rapha=C3=ABl=20Gertz?= Date: Fri, 8 Mar 2024 17:02:10 +0100 Subject: [PATCH] Use google client id and secret env variables --- Command/Calendar2Command.php | 4 ++-- Controller/UserController.php | 12 ++++++------ Resources/config/packages/rapsysair.yaml | 4 ---- 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/Command/Calendar2Command.php b/Command/Calendar2Command.php index c0a739f..ea218e3 100644 --- a/Command/Calendar2Command.php +++ b/Command/Calendar2Command.php @@ -69,8 +69,8 @@ class Calendar2Command extends Command { $this->client = new Client( [ 'application_name' => $_ENV['RAPSYSAIR_GOOGLE_PROJECT'], - 'client_id' => $_ENV['RAPSYSAIR_GOOGLE_CLIENT'], - 'client_secret' => $_ENV['RAPSYSAIR_GOOGLE_SECRET'], + 'client_id' => $_ENV['GOOGLE_CLIENT_ID'], + 'client_secret' => $_ENV['GOOGLE_CLIENT_SECRET'], 'redirect_uri' => $this->router->generate('rapsysair_google_callback', [], UrlGeneratorInterface::ABSOLUTE_URL), 'scopes' => $this->scopes, 'access_type' => 'offline', diff --git a/Controller/UserController.php b/Controller/UserController.php index 021d21f..2e30fdc 100644 --- a/Controller/UserController.php +++ b/Controller/UserController.php @@ -157,9 +157,9 @@ class UserController extends BaseUserController { //Get google client $googleClient = new \Google\Client( [ - 'application_name' => $request->server->get('RAPSYSAIR_GOOGLE_PROJECT'), - 'client_id' => $request->server->get('RAPSYSAIR_GOOGLE_CLIENT'), - 'client_secret' => $request->server->get('RAPSYSAIR_GOOGLE_SECRET'), + 'application_name' => $_ENV['RAPSYSAIR_GOOGLE_PROJECT'], + 'client_id' => $_ENV['GOOGLE_CLIENT_ID'], + 'client_secret' => $_ENV['GOOGLE_CLIENT_SECRET'], 'redirect_uri' => $this->generateUrl('rapsysair_google_callback', [], UrlGeneratorInterface::ABSOLUTE_URL), 'scopes' => self::googleScopes, 'access_type' => 'offline', @@ -615,9 +615,9 @@ class UserController extends BaseUserController { //Get google client $googleClient = new \Google\Client( [ - 'application_name' => $request->server->get('RAPSYSAIR_GOOGLE_PROJECT'), - 'client_id' => $request->server->get('RAPSYSAIR_GOOGLE_CLIENT'), - 'client_secret' => $request->server->get('RAPSYSAIR_GOOGLE_SECRET'), + 'application_name' => $_ENV['RAPSYSAIR_GOOGLE_PROJECT'], + 'client_id' => $_ENV['GOOGLE_CLIENT_ID'], + 'client_secret' => $_ENV['GOOGLE_CLIENT_SECRET'], 'redirect_uri' => $this->generateUrl('rapsysair_google_callback', [], UrlGeneratorInterface::ABSOLUTE_URL), 'scopes' => self::googleScopes, 'access_type' => 'offline', diff --git a/Resources/config/packages/rapsysair.yaml b/Resources/config/packages/rapsysair.yaml index 30a8f8a..54f68ae 100644 --- a/Resources/config/packages/rapsysair.yaml +++ b/Resources/config/packages/rapsysair.yaml @@ -1,11 +1,7 @@ # Parameters configuration parameters: - # Google client - env(RAPSYSAIR_GOOGLE_CLIENT): "Ch4ng3m3!" # Google project env(RAPSYSAIR_GOOGLE_PROJECT): "Ch4ng3m3!" - # Google secret - env(RAPSYSAIR_GOOGLE_SECRET): "Ch4ng3m3!" # Hostname env(RAPSYSAIR_HOSTNAME): "Ch4ng3m3!" # Scheme -- 2.41.1