From 5122efff7fd664c70e92e90d82b1a0ac7edb750b Mon Sep 17 00:00:00 2001 From: Aaron Parecki Date: Sat, 25 Jul 2015 16:51:19 -0700 Subject: [PATCH] remove hard-coded reference to client_id --- controllers/auth.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/controllers/auth.php b/controllers/auth.php index 33baa3e..4ec0db7 100644 --- a/controllers/auth.php +++ b/controllers/auth.php @@ -4,10 +4,6 @@ function buildRedirectURI() { return Config::$base_url . 'auth/callback'; } -function clientID() { - return 'https://quill.p3k.io'; -} - function build_url($parsed_url) { $scheme = isset($parsed_url['scheme']) ? $parsed_url['scheme'] . '://' : ''; $host = isset($parsed_url['host']) ? $parsed_url['host'] : ''; @@ -103,7 +99,7 @@ $app->get('/auth/start', function() use($app) { $_SESSION['auth_state'] = $state; $scope = 'post'; - $authorizationURL = IndieAuth\Client::buildAuthorizationURL($authorizationEndpoint, $me, buildRedirectURI(), clientID(), $state, $scope); + $authorizationURL = IndieAuth\Client::buildAuthorizationURL($authorizationEndpoint, $me, buildRedirectURI(), Config::$base_url, $state, $scope); } else { $authorizationURL = false; } @@ -216,7 +212,7 @@ $app->get('/auth/callback', function() use($app) { $tokenEndpoint = IndieAuth\Client::discoverTokenEndpoint($me); if($tokenEndpoint) { - $token = IndieAuth\Client::getAccessToken($tokenEndpoint, $params['code'], $params['me'], buildRedirectURI(), clientID(), k($params,'state'), true); + $token = IndieAuth\Client::getAccessToken($tokenEndpoint, $params['code'], $params['me'], buildRedirectURI(), Config::$base_url, k($params,'state'), true); } else { $token = array('auth'=>false, 'response'=>false);