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

vue-recaptcha-v3

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-recaptcha-v3 - npm Package Compare versions

Comparing version 1.7.2 to 1.8.0

17

dist/ReCaptchaVuePlugin.js

@@ -44,10 +44,12 @@ "use strict";

var recaptchaLoaded = false;
var recaptchaError = null;
var loadedWaiters = [];
Vue.prototype.$recaptchaLoaded = function () { return new Promise(function (resolve, reject) {
if (recaptchaError !== null) {
return reject(recaptchaError);
}
if (recaptchaLoaded === true) {
resolve(true);
return resolve(true);
}
else {
loadedWaiters.push(resolve);
}
loadedWaiters.push({ resolve: resolve, reject: reject });
}); };

@@ -62,4 +64,7 @@ plugin.initializeReCaptcha(options).then(function (wrapper) {

Vue.prototype.$recaptchaInstance = wrapper;
loadedWaiters.forEach(function (v) { return v(true); });
}).catch(console.error);
loadedWaiters.forEach(function (v) { return v.resolve(true); });
}).catch(function (error) {
recaptchaError = error;
loadedWaiters.forEach(function (v) { return v.reject(error); });
});
}

@@ -66,0 +71,0 @@ exports.VueReCaptcha = VueReCaptcha;

{
"name": "vue-recaptcha-v3",
"version": "1.7.2",
"version": "1.8.0",
"keywords": [

@@ -5,0 +5,0 @@ "captcha",

@@ -32,6 +32,10 @@ # Vue reCAPTCHA-v3

methods: {
recaptcha() {
this.$recaptcha('login').then((token) => {
console.log(token) // Will print the token
})
async recaptcha() {
// (optional) Wait until recaptcha has been loaded.
await this.$recaptchaLoaded()
// Execute reCAPTCHA with action "login".
const token = await this.$recaptcha('login')
// Do stuff with the received token.
}

@@ -51,3 +55,3 @@ },

|siteKey|The site key for your domain from Google.|*string*|*none*
|loaderOptions|Optional options for the [recaptcha-v3](https://github.com/AurityLab/recaptcha-v3) loader. The available options are described [here](https://github.com/AurityLab/recaptcha-v3/#usage-1).|*object*|`null`
|loaderOptions|Optional options for the [recaptcha-v3](https://github.com/AurityLab/recaptcha-v3) loader. The available options are described [here](https://github.com/AurityLab/recaptcha-v3/#load-options-usage).|*object*|`null`

@@ -67,1 +71,16 @@ ### Usage

```
## Advanced usage
Some topics which are not commonly used, but required in some cases.
### Access [reCAPTCHA-v3](https://github.com/AurityLab/recaptcha-v3/#load-options-usage) instance
In some cases it's necessary to interact with the reCAPTCHA-v3 instance, which provides more control over reCAPTCHA.
```javascript
const recaptcha = this.$recaptchaInstance
// Hide reCAPTCHA badge:
recaptcha.hideBadge()
// Show reCAPTCHA badge:
recaptcha.showBadge()
```
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