Skip to content

fuseraft/recaptcha_check

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

recaptcha_check (reCAPTCHA verification)

A simple interface for verifying Google reCAPTCHA responses.

You can find the gem here: RubyGems.org

Installation

gem install recaptcha_check

Methods

RecaptchaCheck#register: sets the reCAPTCHA private key to be used during verification.

RecaptchaCheck#verify: returns true if the reCAPTCHA response passes verification.

Configuration

You must call RecaptchaCheck#register once early in your application to set the reCAPTCHA private key before using RecaptchaCheck#verify in other parts of your application.

RecaptchaCheck.register ENV['var_containing_your_reCAPTCHA_PrivateKey']

Usage in Sinatra app

post '/contact' do
    require 'recaptcha_check'

    if RecaptchaCheck.verify(params)
        # mailer.send params
        redirect '/contact/sent'
    else
        redirect back
    end
end

About

A simple interface for verifying Google reCAPTCHA responses.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages