Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions py4web/utils/hcaptcha.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,12 @@ def field(self):
return Field("h_captcha_response", "hidden", requires=self.validator)

def validator(self, value, _):
print(value)
print(self.secret_key)
# Build payload with secret key and token.
data = {"secret": self.secret_key, "response": value}

# Make POST request with data payload to hCaptcha API endpoint.
res = requests.post(url="https://hcaptcha.com/siteverify", data=data)
print(res.text)
#print(res.text)
try:
if res.json()["success"]:
return (True, None)
Expand Down
Loading