]> Raphaƫl G. Git Repositories - airbundle/blobdiff - Controller/UserController.php
Use google client id and secret env variables
[airbundle] / Controller / UserController.php
index 021d21f1f4c12eea907dd13ef34510227b0844ef..2e30fdc304884e9900db04d05e49658499686272 100644 (file)
@@ -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',