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