X-Git-Url: https://git.cweiske.de/shpub.git/blobdiff_plain/bb34295b8772673294bc77c9f4ce93af57281208..8ed6fa09d116dc02ff089dcffe8bb177c59a9d8e:/src/shpub/Command/Connect.php diff --git a/src/shpub/Command/Connect.php b/src/shpub/Command/Connect.php index e920777..6ac5ed4 100644 --- a/src/shpub/Command/Connect.php +++ b/src/shpub/Command/Connect.php @@ -177,11 +177,13 @@ class Command_Connect protected function getBrowserAuthUrl($host, $user, $redirect_uri, $state, $scope) { + $sep = strpos($host->endpoints->authorization, '?') === false + ? '?' : '&'; return $host->endpoints->authorization - . '?me=' . urlencode($user) + . $sep . 'me=' . urlencode($user) . '&client_id=' . urlencode(static::$client_id) . '&redirect_uri=' . urlencode($redirect_uri) - . '&state=' . $state + . '&state=' . urlencode($state) . '&scope=' . urlencode($scope) . '&response_type=code'; }