diff --git a/.env.test.example b/.env.test.example index c203910..24d7e10 100644 --- a/.env.test.example +++ b/.env.test.example @@ -4,10 +4,11 @@ # API Base URL - Tests default to localhost:3002 for local development API_BASE_URL=http://localhost:3002/api -# For production/remote testing, update to your deployment: +# For production/remote testing with base path, update to your deployment: # API_BASE_URL=https://your-domain.com/uggla/api -# Base path (should match VITE_BASE_PATH) +# Base path (should match VITE_BASE_PATH) - used to construct full API URL +VITE_BASE_PATH=/uggla VITE_BASE_PATH=/uggla # Authentication configuration diff --git a/test_drone_data.py b/test_drone_data.py index 3a0fdf7..6ce2a40 100644 --- a/test_drone_data.py +++ b/test_drone_data.py @@ -56,16 +56,17 @@ def authenticate(): try: print(f"🔐 Authenticating as user: {USERNAME}") - response = requests.post(f"{API_BASE_URL}/auth/login", json=login_data, verify=False) + response = requests.post(f"{API_BASE_URL}/users/login", json=login_data, verify=False) if response.status_code == 200: data = response.json() - AUTH_TOKEN = data.get('token') + AUTH_TOKEN = data.get('data', {}).get('token') if AUTH_TOKEN: print("✅ Authentication successful") return True else: print("❌ No token received in response") + print(f"Response data: {data}") return False else: print(f"❌ Authentication failed: {response.status_code}") diff --git a/test_orlan_detection.py b/test_orlan_detection.py index 713d96d..7b28cd3 100644 --- a/test_orlan_detection.py +++ b/test_orlan_detection.py @@ -54,16 +54,17 @@ def authenticate(): try: print(f"🔐 Authenticating as user: {USERNAME}") - response = requests.post(f"{API_BASE_URL}/auth/login", json=login_data, verify=False) + response = requests.post(f"{API_BASE_URL}/users/login", json=login_data, verify=False) if response.status_code == 200: data = response.json() - AUTH_TOKEN = data.get('token') + AUTH_TOKEN = data.get('data', {}).get('token') if AUTH_TOKEN: print("✅ Authentication successful") return True else: print("❌ No token received in response") + print(f"Response data: {data}") return False else: print(f"❌ Authentication failed: {response.status_code}") diff --git a/test_orlan_scenario.py b/test_orlan_scenario.py index 210d518..bf3c18b 100644 --- a/test_orlan_scenario.py +++ b/test_orlan_scenario.py @@ -48,16 +48,17 @@ def authenticate(): try: print(f"🔐 Authenticating as user: {USERNAME}") - response = requests.post(f"{API_BASE_URL}/auth/login", json=login_data, verify=False) + response = requests.post(f"{API_BASE_URL}/users/login", json=login_data, verify=False) if response.status_code == 200: data = response.json() - AUTH_TOKEN = data.get('token') + AUTH_TOKEN = data.get('data', {}).get('token') if AUTH_TOKEN: print("✅ Authentication successful") return True else: print("❌ No token received in response") + print(f"Response data: {data}") return False else: print(f"❌ Authentication failed: {response.status_code}")