New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

angular1-recaptcha

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

angular1-recaptcha

AngularJS Recaptcha Directive

  • 1.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
decreased by-25%
Maintainers
1
Weekly downloads
 
Created
Source

angular1-recaptcha

AngularJS 1.x directive that provides support for Google's ReCaptcha v2 Checkbox validation.

Usage

  1. Install with npm
npm install --save angular1-recaptcha
  1. Include on your app definition and put your site key
angular
.module('app', [
    // ...
    require('angular1-recaptcha')
])
.constant('RECAPTCHA_SITE_KEY', "YOUR-SITE-KEY") // this step is optional
// if you provide later in your template
  1. Use the directive on your template
<recaptcha ng-model="ctrl.recaptcha"></recaptcha>

You can optionally provide data-theme="dark" (the default is light) or data-site-key="YOUR-SITE-KEY" (the default is the one you provided as a constant on Step 1).

ng-model is where the token received from the recaptcha library is stored. You can set it to null to reset the recaptcha, or you can put ng-disabled="!ctrl.recaptcha" on your button to prevent the form beign submitted without a valid captcha token.

Recaptcha Library Dependency

You do not have to include Google's Recaptcha script. This library includes asynchronous & deffered way to include it if the library itself is not found. Multiple instances of the directive does not lead to recaptcha library is beign included twice.

Server-Side validation

Please see the Google's documentation about the validation that needs to be occur in the server-side.

FAQs

Package last updated on 16 Jul 2020

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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc