diff --git a/src/OAuth_io/OAuth.php b/src/OAuth_io/OAuth.php index c32dad0..e0daa34 100644 --- a/src/OAuth_io/OAuth.php +++ b/src/OAuth_io/OAuth.php @@ -126,7 +126,7 @@ public function refreshCredentials($credentials, $force = false) { } public function redirect($provider, $url) { - $urlToRedirect = 'http' . (isset($_SERVER['HTTPS']) ? 's' : '') . '://' . $_SERVER['HTTP_HOST'] . $url; + $urlToRedirect = 'http' . ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') ? 's' : '') . '://' . $_SERVER['HTTP_HOST'] . $url; $csrf = $this->generateStateToken(); $location = $this->injector->config['oauthd_url'] . $this->injector->config['oauthd_base'] . '/' . $provider . '?k=' . $this->injector->config['app_key'] . '&opts=' .