From: Raphaƫl Gertz Date: Fri, 8 Mar 2024 16:02:10 +0000 (+0100) Subject: Use google client id and secret env variables X-Git-Tag: 0.4.0~6 X-Git-Url: https://git.rapsys.eu/airbundle/commitdiff_plain/741cdfe32a8529ef11e24ddccafd0013289c56e5 Use google client id and secret env variables --- 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