Loading auth/oauth2/facebook_token.php +3 −2 Original line number Original line Diff line number Diff line Loading @@ -37,8 +37,9 @@ $fb = new Facebook\Facebook([ ]); ]); $helper = $fb->getRedirectLoginHelper(); $helper = $fb->getRedirectLoginHelper(); if (isset($_GET['state'])) { $state = filter_input(INPUT_GET, 'search', FILTER_SANITIZE_STRING); $helper->getPersistentDataHandler()->set('state', $_GET['state']); if ($state !== null) { $helper->getPersistentDataHandler()->set('state', $state); } } try { try { Loading auth/oauth2/google_token.php +4 −3 Original line number Original line Diff line number Diff line Loading @@ -44,9 +44,10 @@ if (isset($_REQUEST['logout'])) { unset($_SESSION['access_token']); unset($_SESSION['access_token']); } } if (isset($_GET['code'])) { $code = filter_input(INPUT_GET, 'code', FILTER_SANITIZE_STRING); if ($code !== null) { // An access token has been returned from the auth URL. // An access token has been returned from the auth URL. $client->authenticate($_GET['code']); $client->authenticate($code); $_SESSION['access_token'] = $client->getAccessToken(); $_SESSION['access_token'] = $client->getAccessToken(); } } Loading @@ -63,7 +64,7 @@ if ($client->getAccessToken()) { $res = $service->people->get('people/me', array('requestMask.includeField' => 'person.names,person.email_addresses')); $res = $service->people->get('people/me', array('requestMask.includeField' => 'person.names,person.email_addresses')); } catch (Google_Service_Exception $e) { } catch (Google_Service_Exception $e) { echo '<p>' . json_encode($e->getErrors()) . '</p>'; echo '<p>' . json_encode($e->getErrors()) . '</p>'; $thisPage = $PROTOCOL . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']; $thisPage = $PROTOCOL . $_SERVER['HTTP_HOST'] . htmlspecialchars($_SERVER["PHP_SELF"], ENT_QUOTES, "utf-8"); echo '<p><a href="' . $thisPage . '?logout">Click here to unset the access token</a></p>'; echo '<p><a href="' . $thisPage . '?logout">Click here to unset the access token</a></p>'; } } Loading Loading
auth/oauth2/facebook_token.php +3 −2 Original line number Original line Diff line number Diff line Loading @@ -37,8 +37,9 @@ $fb = new Facebook\Facebook([ ]); ]); $helper = $fb->getRedirectLoginHelper(); $helper = $fb->getRedirectLoginHelper(); if (isset($_GET['state'])) { $state = filter_input(INPUT_GET, 'search', FILTER_SANITIZE_STRING); $helper->getPersistentDataHandler()->set('state', $_GET['state']); if ($state !== null) { $helper->getPersistentDataHandler()->set('state', $state); } } try { try { Loading
auth/oauth2/google_token.php +4 −3 Original line number Original line Diff line number Diff line Loading @@ -44,9 +44,10 @@ if (isset($_REQUEST['logout'])) { unset($_SESSION['access_token']); unset($_SESSION['access_token']); } } if (isset($_GET['code'])) { $code = filter_input(INPUT_GET, 'code', FILTER_SANITIZE_STRING); if ($code !== null) { // An access token has been returned from the auth URL. // An access token has been returned from the auth URL. $client->authenticate($_GET['code']); $client->authenticate($code); $_SESSION['access_token'] = $client->getAccessToken(); $_SESSION['access_token'] = $client->getAccessToken(); } } Loading @@ -63,7 +64,7 @@ if ($client->getAccessToken()) { $res = $service->people->get('people/me', array('requestMask.includeField' => 'person.names,person.email_addresses')); $res = $service->people->get('people/me', array('requestMask.includeField' => 'person.names,person.email_addresses')); } catch (Google_Service_Exception $e) { } catch (Google_Service_Exception $e) { echo '<p>' . json_encode($e->getErrors()) . '</p>'; echo '<p>' . json_encode($e->getErrors()) . '</p>'; $thisPage = $PROTOCOL . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']; $thisPage = $PROTOCOL . $_SERVER['HTTP_HOST'] . htmlspecialchars($_SERVER["PHP_SELF"], ENT_QUOTES, "utf-8"); echo '<p><a href="' . $thisPage . '?logout">Click here to unset the access token</a></p>'; echo '<p><a href="' . $thisPage . '?logout">Click here to unset the access token</a></p>'; } } Loading