+5
-5
src/webapp/api.v
+5
-5
src/webapp/api.v
···
24
24
// before doing *anything*, check the captchas
25
25
if app.config.hcaptcha.enabled {
26
26
token := ctx.form['h-captcha-response']
27
-
response := http.post_json('https://api.hcaptcha.com/siteverify', '{
28
-
"secret": "${app.config.hcaptcha.secret}",
29
-
// "remoteip": "${ctx.ip()}",
30
-
"response": "${token}"
31
-
}') or {
27
+
response := http.post_form('https://api.hcaptcha.com/siteverify', {
28
+
'secret': app.config.hcaptcha.secret
29
+
'remoteip': ctx.ip()
30
+
'response': token
31
+
}) or {
32
32
ctx.error('failed to post hcaptcha response: ${err}')
33
33
return ctx.redirect('/register')
34
34
}