mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-08 20:22:42 +01:00
Clarify API secret error
This commit is contained in:
parent
2b83aa45f9
commit
092f842592
@ -25,6 +25,7 @@ class ApiCheck {
|
||||
{
|
||||
$loggingIn = $request->is('api/v1/login') || $request->is('api/v1/register');
|
||||
$headers = Utils::getApiHeaders();
|
||||
$hasApiSecret = false;
|
||||
|
||||
if ($secret = env(API_SECRET)) {
|
||||
$hasApiSecret = hash_equals($request->api_secret ?: '', $secret);
|
||||
@ -34,7 +35,7 @@ class ApiCheck {
|
||||
// check API secret
|
||||
if ( ! $hasApiSecret) {
|
||||
sleep(ERROR_DELAY);
|
||||
return Response::json('Invalid secret', 403, $headers);
|
||||
return Response::json('Invalid value for API_SECRET', 403, $headers);
|
||||
}
|
||||
} else {
|
||||
// check for a valid token
|
||||
|
Loading…
Reference in New Issue
Block a user