mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 05:02:36 +01:00
Support sending API secret as header
This commit is contained in:
parent
c82e8476dc
commit
b7c783aa15
@ -30,7 +30,8 @@ class ApiCheck {
|
||||
$hasApiSecret = false;
|
||||
|
||||
if ($secret = env(API_SECRET)) {
|
||||
$hasApiSecret = hash_equals($request->api_secret ?: '', $secret);
|
||||
$requestSecret = Request::header('X-Ninja-Secret') ?: ($request->api_secret ?: '');
|
||||
$hasApiSecret = hash_equals($requestSecret, $secret);
|
||||
}
|
||||
|
||||
if ($loggingIn) {
|
||||
|
Loading…
Reference in New Issue
Block a user