Join our webinar on Wednesday, June 26, at 1pm EDTHow Chia Mitigates Risk in the Crypto Industry.Register
Socket
Socket
Sign inDemoInstall

vue-turnstile

Package Overview
Dependencies
21
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.6 to 1.0.7

60

dist/vue-turnstile.js

@@ -1,7 +0,7 @@

import { defineComponent as a, openBlock as u, createElementBlock as l } from "vue";
const c = "https://challenges.cloudflare.com/turnstile/v0/api.js", d = "cfTurnstileOnLoad";
let i = typeof window < "u" && window.turnstile !== void 0 ? "ready" : "unloaded", s;
const p = a({
import { defineComponent as d, openBlock as u, createElementBlock as l } from "vue";
const c = "https://challenges.cloudflare.com/turnstile/v0/api.js", a = "cfTurnstileOnLoad";
let i = typeof window < "u" && window.turnstile !== void 0 ? "ready" : "unloaded", n;
const p = d({
name: "VueTurnstile",
emits: ["update:modelValue"],
emits: ["update:modelValue", "error", "unsupported"],
props: {

@@ -61,3 +61,5 @@ siteKey: {

action: this.action,
appearance: this.appearance
appearance: this.appearance,
"error-callback": this.errorCallback,
"unsupported-callback": this.unsupportedCallback
};

@@ -67,5 +69,11 @@ }

methods: {
callback(r) {
this.$emit("update:modelValue", r), this.startResetTimeout();
unsupportedCallback() {
this.$emit("unsupported");
},
errorCallback(e) {
this.$emit("error", e);
},
callback(e) {
this.$emit("update:modelValue", e), this.startResetTimeout();
},
reset() {

@@ -87,16 +95,16 @@ window.turnstile && (this.$emit("update:modelValue", ""), window.turnstile.reset());

async mounted() {
const r = new Promise((t, e) => {
s = { resolve: t, reject: e }, i === "ready" && t(void 0);
const e = new Promise((r, t) => {
n = { resolve: r, reject: t }, i === "ready" && r(void 0);
});
window[d] = () => {
s.resolve(), i = "ready";
window[a] = () => {
n.resolve(), i = "ready";
}, await (() => {
if (i === "unloaded") {
i = "loading";
const t = `${c}?onload=${d}&render=explicit`, e = document.createElement("script");
e.src = t, e.async = !0, e.addEventListener("error", () => {
s.reject("Failed to load Turnstile.");
}), document.head.appendChild(e);
const r = `${c}?onload=${a}&render=explicit`, t = document.createElement("script");
t.src = r, t.async = !0, t.addEventListener("error", () => {
n.reject("Failed to load Turnstile.");
}), document.head.appendChild(t);
}
return r;
return e;
})(), this.renderOnMount && this.render();

@@ -107,14 +115,14 @@ },

}
}), m = (r, n) => {
const t = r.__vccOpts || r;
for (const [e, o] of n)
t[e] = o;
return t;
}, f = { ref: "turnstile" };
function h(r, n, t, e, o, w) {
return u(), l("div", f, null, 512);
}), m = (e, s) => {
const r = e.__vccOpts || e;
for (const [t, o] of s)
r[t] = o;
return r;
}, h = { ref: "turnstile" };
function f(e, s, r, t, o, w) {
return u(), l("div", h, null, 512);
}
const v = /* @__PURE__ */ m(p, [["render", h]]);
const v = /* @__PURE__ */ m(p, [["render", f]]);
export {
v as default
};

@@ -60,4 +60,8 @@ import type { PropType } from 'vue';

appearance: "always" | "execute" | "interaction-only";
'error-callback': (code: string) => void;
'unsupported-callback': () => void;
};
}, {
unsupportedCallback(): void;
errorCallback(code: string): void;
callback(token: string): void;

@@ -68,3 +72,3 @@ reset(): void;

startResetTimeout(): void;
}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:modelValue"[], "update:modelValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "error" | "unsupported")[], "update:modelValue" | "error" | "unsupported", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
siteKey: {

@@ -110,2 +114,4 @@ type: StringConstructor;

"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
onError?: ((...args: any[]) => any) | undefined;
onUnsupported?: ((...args: any[]) => any) | undefined;
}, {

@@ -112,0 +118,0 @@ resetInterval: number;

{
"name": "vue-turnstile",
"version": "1.0.6",
"version": "1.0.7",
"description": "Vue library for Cloudflare Turnstile CAPTCHA alternative",

@@ -5,0 +5,0 @@ "type": "module",

@@ -66,2 +66,11 @@ # vue-turnstile

## Events
| Method | Params | Description |
| -------------- | ------- | ------------------ |
| `@error` | `code` | Callback invoked when there is an error (e.g. network error or the challenge failed). |
| `@unsupported` | - | Callback invoked when a given client/browser is not supported by Turnstile. |
## Author

@@ -68,0 +77,0 @@

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc