Fix auth bearer
This commit is contained in:
@@ -34,10 +34,18 @@ if (auth_enabled()) {
|
|||||||
$token_ok = false;
|
$token_ok = false;
|
||||||
if (TRIGGER_TOKEN !== '') {
|
if (TRIGGER_TOKEN !== '') {
|
||||||
$provided = '';
|
$provided = '';
|
||||||
|
if (function_exists('apache_request_headers')) {
|
||||||
|
$requestHeaders = apache_request_headers();
|
||||||
|
if (isset($requestHeaders['authorization'])) {
|
||||||
|
$authToken = $requestHeaders['authorization'];
|
||||||
|
$provided = substr($authToken, 7);
|
||||||
|
}
|
||||||
|
}
|
||||||
$auth_header = $_SERVER['HTTP_AUTHORIZATION'] ?? '';
|
$auth_header = $_SERVER['HTTP_AUTHORIZATION'] ?? '';
|
||||||
if (str_starts_with($auth_header, 'Bearer ')) {
|
if (str_starts_with($auth_header, 'Bearer ')) {
|
||||||
$provided = substr($auth_header, 7);
|
$provided = substr($auth_header, 7);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($provided === '' && isset($_REQUEST['token'])) {
|
if ($provided === '' && isset($_REQUEST['token'])) {
|
||||||
$provided = $_REQUEST['token'];
|
$provided = $_REQUEST['token'];
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user