Fix jwt-token

This commit is contained in:
2025-09-07 11:20:37 +02:00
parent 5f8938d5bb
commit 2e17e4d1d4
4 changed files with 12 additions and 8 deletions

View File

@@ -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}")