Socket
Book a DemoInstallSign in
Socket

zero-captcha

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

zero-captcha

0.0.7
bundlerRubygems
Version published
Maintainers
1
Created
Source

Zero Captcha

The simplest way to add a zero friction captcha in your Rails forms.

A zero captcha works off the idea that most simple bots do not run a full JavaScript interpreter when crawling web forms, so they are unable to fill a required field whereas the required field is actually hidden and autopopulated by JavaScript in a real browser with a real human. This means having a layer of spam protection while maintaining zero friction.

This should not be used solely by itself, but can be useful as an extra layer of defense alongside honeypot captchas and/or more traditional captchas.

Requirements

Requires Rails 5+

Installation

In your Gemfile, simply add

gem 'zero-captcha'

Usage

form_for

Simply specify that the form has a honeypot in the HTML options hash:

<% form_for Comment.new, html: { zero_captcha: true } do |form| -%>
  ...
<% end -%>

form_tag with block

Simply specify that the form has a honeypot in the options hash:

<% form_tag comments_path, zero_captcha: true do -%>
  ...
<% end -%>

form_tag without block

Simply specify that the form has a honeypot in the options hash:

<%= form_tag comments_path, zero_captcha: true -%>
  ...
</form>

Additional Usage

By default, zero-captcha works by checking against a verify value if provided. If not provided, zero captcha will not activate.

However, if you wish to force the presence of a zero-captcha value, you may use this in your controller:

prepend_before_filter :require_zero_captcha, only: [:create]

See LICENSE for details.

FAQs

Package last updated on 18 Jan 2024

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.