Fix jwt-token

This commit is contained in:
2025-09-07 09:07:40 +02:00
parent af072b74fd
commit 3d4ea88269
6 changed files with 178 additions and 11 deletions

View File

@@ -11,11 +11,20 @@ import time
import random
import math
import argparse
import os
from datetime import datetime, timedelta
# Configuration
API_BASE_URL = "https://selfservice.cqers.com/drones/api"
# Alternative for local testing: "http://localhost:3002/api"
# Configuration from environment variables
API_BASE_URL = os.getenv('API_BASE_URL', 'http://localhost:3002/api')
BASE_PATH = os.getenv('VITE_BASE_PATH', '').rstrip('/')
# If BASE_PATH is set, construct the full URL
if BASE_PATH and not API_BASE_URL.endswith('/api'):
# Extract domain from API_BASE_URL and add base path
domain = API_BASE_URL.replace('/api', '').replace('/drones/api', '').replace('/uggla/api', '')
API_BASE_URL = f"{domain}{BASE_PATH}/api"
print(f"🔗 Using API Base URL: {API_BASE_URL}")
# Debug configuration
DEBUG_MODE = False # Set to True to enable payload debugging