Socket
Book a DemoInstallSign in
Socket

jpoz-sinatra-recaptcha

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jpoz-sinatra-recaptcha

0.0.2
bundlerRubygems
Version published
Maintainers
1
Created
Source

Quick, simple, easy way to implement REcaptcha for Sinatra apps

Installation

gem sources -a http://gems.github.com

sudo gem install jpoz-sinatra-captcha


require 'rubygems'
require 'sinatra'
require 'sinatra/recaptcha'

configure do
   # https://admin.recaptcha.net/accounts/signup/
   Sinatra::ReCaptcha.public_key  = 'your_public_key'
   Sinatra::ReCaptcha.private_key = 'your_private_key'
   # to use ssl set Sinatra::ReCaptcha.server = 'https://api-secure.recaptcha.net'
end


get '/' do
  haml :recaptcha
end

post '/' do
  halt(401, "invalid captcha") unless captcha_correct?
  "passed!"
end

__END__

@@ captcha

%h1 Try ReCaptcha
%form{:method=>"post", :action=>"/post"}
  = recaptcha
  # you can also use recaptcha(:ajax) to use a pure ajax version
  %input{:type=>'submit', :value => 'Send'}

FAQs

Package last updated on 11 Aug 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.