lua recaptcha
Google backend implementation for lua.
#luarocks install lua-recaptcha
Paste the following snippet in the HEAD section
<script src='https://www.google.com/recaptcha/api.js'></script>
Paste the following at the end of the form. You need to specify the callback function to
handle the result.
<button class="g-recaptcha" data-sitekey="<your-site-key>" data-callback="YourOnSubmitFn"> Submit </button>
new(site_key, secret_key)
valid(g_captcha_response, remote_ip)
local recaptcha = require 'recaptcha'
local captcha = recaptcha:new(site_key, secret_key)
if captcha.valid(g_captcha_response, remote_ip) then
ngx.say('valid captcha')
end