fix: Fix domain owner address check
All checks were successful
Build Docker / BuildImage (push) Successful in 2m22s

This commit is contained in:
2025-07-03 11:12:55 +10:00
parent 50818011c9
commit 491caedd8a

View File

@@ -111,15 +111,15 @@ def renew():
# Check the owner is correct
api = os.getenv("API")
req = requests.get(f"{api}/verify?domain={domain}")
print(json.dumps(req.json(), indent=4))
if req.status_code != 200:
return redirect("/?error=api_error")
req = req.json()
if req["error"] != None:
return redirect("/?error=api_error")
# Check if error is present
if "error" in req and req["error"] != None:
return redirect(f"/?error={req['error']}")
# if req["result"]["owner_tx_data"]["address"] not in allowed_owners:
# return redirect("/?error=not_anyone")
if req["address"] not in allowed_owners:
return redirect("/?error=not_anyone")
return redirect(f"https://pay.hns.au/p/renew?amount=10&data={domain}&redirect=https://renew.hns.au/?message=Pending:%20The%20domain%20will%20renew%20when%20the%20payment%20has%20arrived")
except requests.RequestException as e: