Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@hcaptcha/react-hcaptcha

Package Overview
Dependencies
Maintainers
3
Versions
49
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hcaptcha/react-hcaptcha - npm Package Compare versions

Comparing version 0.1.4 to 0.1.5

.gitattributes

2

dist/component/HCaptcha.js

@@ -166,2 +166,2 @@ "use strict";

exports.default = HCaptcha;
exports.default = HCaptcha;

@@ -17,3 +17,3 @@ "use strict";

var CaptchaScript = function CaptchaScript(cb, hl) {
var CaptchaScript = function CaptchaScript(cb, hl, endpoint) {
// Create script to init hCaptcha

@@ -26,6 +26,10 @@ var script = document.createElement("script");

if (typeof hl != "undefined" && hl != null) {
if (hl) {
script.src += "&hl=" + hl;
}
if (endpoint) {
script.src += "&endpoint=" + encodeURIComponent(endpoint);
}
return script;

@@ -53,5 +57,8 @@ };

_this.closeCaptcha = _this.closeCaptcha.bind(_this);
_this.resetCaptcha = _this.resetCaptcha.bind(_this);
// https://hcaptcha.com/docs/languages lists available codes.
_this.languageOverride = props.languageOverride;
// custom endpoint
_this.endpoint = props.endpoint;

@@ -81,3 +88,3 @@ _this._id = null;

//Check if hCaptcha has already been loaded, if not create script tag and wait to render captcha element - hCaptcha
var script = CaptchaScript(this.onloadScript, this.languageOverride);
var script = CaptchaScript(this.onloadScript, this.languageOverride, this.endpoint);
document.getElementById(hCaptchaVars.element_id).appendChild(script);

@@ -94,2 +101,5 @@ } else {

if (this._removed === false) this.removeFrame();
// Reset any stored variables / timers when unmounting
hcaptcha.reset(this._id);
}

@@ -96,0 +106,0 @@ }, {

@@ -18,3 +18,3 @@ const React = require('react');

// To force a language, use the code: https://hcaptcha.com/docs/languages
this.languageOverride = null; // "fr";
this.languageOverride = null; // "fr";
}

@@ -21,0 +21,0 @@

{
"name": "@hcaptcha/react-hcaptcha",
"version": "0.1.4",
"version": "0.1.5",
"description": "A React library for hCaptcha",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

const React = require('react');
const CaptchaScript = (cb, hl) => { // Create script to init hCaptcha
const CaptchaScript = (cb, hl, endpoint) => { // Create script to init hCaptcha
let script = document.createElement("script")

@@ -10,6 +10,10 @@

if (typeof hl != "undefined" && hl != null) {
script.src += `&hl=${hl}`
if (hl) {
script.src += `&hl=${hl}`
}
if (endpoint) {
script.src += `&endpoint=${encodeURIComponent(endpoint)}`;
}
return script;

@@ -33,5 +37,8 @@ }

this.closeCaptcha = this.closeCaptcha.bind(this)
this.resetCaptcha = this.resetCaptcha.bind(this)
// https://hcaptcha.com/docs/languages lists available codes.
this.languageOverride = props.languageOverride
// custom endpoint
this.endpoint = props.endpoint

@@ -56,3 +63,3 @@ this._id = null

if (typeof hcaptcha === 'undefined') { //Check if hCaptcha has already been loaded, if not create script tag and wait to render captcha element - hCaptcha
let script = CaptchaScript(this.onloadScript, this.languageOverride);
let script = CaptchaScript(this.onloadScript, this.languageOverride, this.endpoint);
document.getElementById(hCaptchaVars.element_id).appendChild(script);

@@ -67,2 +74,5 @@ } else {

if (this._removed === false) this.removeFrame()
// Reset any stored variables / timers when unmounting
hcaptcha.reset(this._id)
}

@@ -134,2 +144,2 @@

module.exports = HCaptcha;
module.exports = HCaptcha;

Sorry, the diff of this file is not supported yet

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