fix: Use CloudApiKeyMissingError for local mode consistency
Signed-off-by: Nikoloz Turazashvili <turazashvili@gmail.com>
This commit is contained in:
parent
1fc8e5ad08
commit
2651b34e41
1 changed files with 2 additions and 8 deletions
|
|
@ -16,13 +16,7 @@ def get_checks_router():
|
||||||
api_token = request.headers.get("X-Api-Key")
|
api_token = request.headers.get("X-Api-Key")
|
||||||
|
|
||||||
if api_token is None:
|
if api_token is None:
|
||||||
# Return a graceful response for local/self-hosted installations
|
raise CloudApiKeyMissingError()
|
||||||
return {
|
|
||||||
"status": "local_mode",
|
|
||||||
"message": "Running in local mode. Cloud features are not available without API key.",
|
|
||||||
"cloud_available": False,
|
|
||||||
"local_mode": True,
|
|
||||||
}
|
|
||||||
|
|
||||||
return await check_api_key(api_token)
|
return await check_api_key(api_token)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue