mirror of
https://github.com/neocities/neocities.git
synced 2025-05-28 11:10:14 +02:00
replace recaptch with hcaptcha
This commit is contained in:
parent
6d87c80df1
commit
bc0addb27b
14 changed files with 46 additions and 63 deletions
|
@ -118,24 +118,6 @@ def flash_display(opts={})
|
|||
erb :'_flash', layout: false, locals: {opts: opts}
|
||||
end
|
||||
|
||||
def recaptcha_valid?
|
||||
return true if ENV['RACK_ENV'] == 'test' || ENV['TRAVIS']
|
||||
return false unless params[:'g-recaptcha-response']
|
||||
resp = Net::HTTP.get URI(
|
||||
'https://www.google.com/recaptcha/api/siteverify?'+
|
||||
Rack::Utils.build_query(
|
||||
secret: $config['recaptcha_private_key'],
|
||||
response: params[:'g-recaptcha-response']
|
||||
)
|
||||
)
|
||||
|
||||
if JSON.parse(resp)['success'] == true
|
||||
true
|
||||
else
|
||||
false
|
||||
end
|
||||
end
|
||||
|
||||
def hcaptcha_valid?
|
||||
return true if ENV['RACK_ENV'] == 'test' || ENV['TRAVIS']
|
||||
return false unless params[:'h-captcha-response']
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue