X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FSecurity%2FBasicAuth.php;h=7b6a6b082502d982e0827141434a7c31df437b84;hb=0165811f09260a61af6dd947015be40df52d7b67;hp=52657057e9078bedd34af0a2e5d75a700b18fa8d;hpb=42bd7918ad7172cdd3d2134d9be1478cd88a694d;p=friendica.git diff --git a/src/Security/BasicAuth.php b/src/Security/BasicAuth.php index 52657057e9..7b6a6b0825 100644 --- a/src/Security/BasicAuth.php +++ b/src/Security/BasicAuth.php @@ -78,9 +78,9 @@ class BasicAuth return []; } - if (!empty(self::$current_token)) { - return self::$current_token; - } + //if (!empty(self::$current_token)) { + // return self::$current_token; + //} $source = $_REQUEST['source'] ?? ''; @@ -177,7 +177,10 @@ class BasicAuth return 0; } Logger::debug('Access denied', ['parameters' => $_SERVER]); - header('WWW-Authenticate: Basic realm="Friendica"'); + // Checking for commandline for the tests, we have to avoid to send a header + if (php_sapi_name() !== 'cli') { + header('WWW-Authenticate: Basic realm="Friendica"'); + } throw new UnauthorizedException("This API requires login"); }