Added new method to verify
This commit is contained in:
parent
adddfb2737
commit
ee1208671e
@ -135,7 +135,6 @@ def hoptcha_protected(
|
|||||||
pass # Malformed or empty JSON
|
pass # Malformed or empty JSON
|
||||||
|
|
||||||
if not token or not verify_token(token):
|
if not token or not verify_token(token):
|
||||||
print(token)
|
|
||||||
return response(request) if response else JsonResponse({
|
return response(request) if response else JsonResponse({
|
||||||
"captcha": True,
|
"captcha": True,
|
||||||
"url": f"{HOPTCHA_URL}?{urlencode({'client_key': HOPTCHA_CLIENT_ID, 'timestamp': int(time.time() * 1000), 'type': type})}"
|
"url": f"{HOPTCHA_URL}?{urlencode({'client_key': HOPTCHA_CLIENT_ID, 'timestamp': int(time.time() * 1000), 'type': type})}"
|
||||||
|
@ -42,8 +42,6 @@ def verify_token(token):
|
|||||||
headers = {"Content-Type": "application/json"}
|
headers = {"Content-Type": "application/json"}
|
||||||
response = requests.post(HOPTCHA_VERIFY_URL, data=json.dumps(payload), headers=headers, timeout=5)
|
response = requests.post(HOPTCHA_VERIFY_URL, data=json.dumps(payload), headers=headers, timeout=5)
|
||||||
|
|
||||||
print(HOPTCHA_VERIFY_URL, HOPTCHA_CLIENT_SECRET)
|
|
||||||
|
|
||||||
if response.status_code == 200:
|
if response.status_code == 200:
|
||||||
return response.json().get("success", False)
|
return response.json().get("success", False)
|
||||||
return False
|
return False
|
||||||
|
Loading…
x
Reference in New Issue
Block a user