@hcaptcha/react-hcaptcha
Advanced tools
Comparing version 0.2.0 to 0.2.1
@@ -38,3 +38,3 @@ 'use strict'; | ||
// Generate hCaptcha API Script | ||
var CaptchaScript = function CaptchaScript(hl) { | ||
var CaptchaScript = function CaptchaScript(hl, reCaptchaCompat) { | ||
// Create global onload callback | ||
@@ -55,2 +55,5 @@ window.hcaptchaOnLoad = function () { | ||
} | ||
if (reCaptchaCompat === false) { | ||
script.src += '&recaptchacompat=off'; | ||
} | ||
@@ -100,3 +103,5 @@ document.head.appendChild(script); | ||
//Once captcha is mounted intialize hCaptcha - hCaptcha | ||
var languageOverride = this.props.languageOverride; | ||
var _props = this.props, | ||
languageOverride = _props.languageOverride, | ||
reCaptchaCompat = _props.reCaptchaCompat; | ||
var _state = this.state, | ||
@@ -113,3 +118,3 @@ isApiReady = _state.isApiReady, | ||
captchaScriptCreated = true; | ||
CaptchaScript(languageOverride); | ||
CaptchaScript(languageOverride, reCaptchaCompat); | ||
} | ||
@@ -116,0 +121,0 @@ |
{ | ||
"name": "@hcaptcha/react-hcaptcha", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"description": "A React library for hCaptcha", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -9,3 +9,3 @@ # React hCaptcha Component Library | ||
Sign up at [hCaptcha](https://wwww.hcaptcha.com) to get your sitekey today. **You need a sitekey to use this captcha solution.** | ||
Sign up at [hCaptcha](https://www.hcaptcha.com) to get your sitekey today. **You need a sitekey to use this captcha solution.** | ||
@@ -77,2 +77,4 @@ ## Installation | ||
- Manually set the ID of the hCaptcha component. Make sure each hCaptcha component generated on a single page has its own unique ID when using this prop. | ||
- reCaptchaCompat: Boolean | ||
- Disable drop-in replacement for reCAPTCHA with `false` to prevent hCaptcha from injecting into `window.grecaptcha`. Enabled by default. | ||
@@ -79,0 +81,0 @@ The component emits events related to verification and expiration. Simply catch these events in the parent component: `onVerify`, `onExpire`, `onError` and handle the events as you choose. The captcha will automatically reset on error, but still emits an error. |
@@ -25,3 +25,3 @@ const React = require('react'); | ||
// Generate hCaptcha API Script | ||
const CaptchaScript = (hl) => { | ||
const CaptchaScript = (hl, reCaptchaCompat) => { | ||
// Create global onload callback | ||
@@ -42,2 +42,5 @@ window.hcaptchaOnLoad = () => { | ||
} | ||
if (reCaptchaCompat === false) { | ||
script.src += '&recaptchacompat=off' | ||
} | ||
@@ -78,3 +81,3 @@ document.head.appendChild(script); | ||
componentDidMount () { //Once captcha is mounted intialize hCaptcha - hCaptcha | ||
const { languageOverride } = this.props; | ||
const { languageOverride, reCaptchaCompat } = this.props; | ||
const { isApiReady, elementId } = this.state; | ||
@@ -88,3 +91,3 @@ | ||
captchaScriptCreated = true; | ||
CaptchaScript(languageOverride); | ||
CaptchaScript(languageOverride, reCaptchaCompat); | ||
} | ||
@@ -91,0 +94,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
33474
649
98