Fix jwt-token
This commit is contained in:
@@ -21,9 +21,10 @@ warnings.filterwarnings('ignore', message='Unverified HTTPS request')
|
||||
API_BASE_URL = os.getenv('API_BASE_URL', 'http://localhost:3002/api')
|
||||
BASE_PATH = os.getenv('VITE_BASE_PATH', '').rstrip('/')
|
||||
|
||||
# Authentication configuration
|
||||
# Authentication configuration - Optional for local testing
|
||||
USERNAME = os.getenv('TEST_USERNAME', 'admin')
|
||||
PASSWORD = os.getenv('TEST_PASSWORD', 'admin123')
|
||||
SKIP_AUTH = os.getenv('SKIP_AUTH', 'false').lower() == 'true' # Set to 'true' to skip authentication
|
||||
|
||||
# If BASE_PATH is set, construct the full URL
|
||||
if BASE_PATH and not API_BASE_URL.endswith('/api'):
|
||||
@@ -68,6 +69,9 @@ def authenticate():
|
||||
|
||||
def get_auth_headers():
|
||||
"""Get headers with authentication token"""
|
||||
if SKIP_AUTH:
|
||||
return {"Content-Type": "application/json"}
|
||||
|
||||
if AUTH_TOKEN:
|
||||
return {
|
||||
"Authorization": f"Bearer {AUTH_TOKEN}",
|
||||
|
||||
Reference in New Issue
Block a user