disable recaptcha

This commit is contained in:
2023-04-26 20:25:38 +10:00
parent 50aaf8b343
commit ac326d2d74
16 changed files with 45 additions and 63 deletions

View File

@@ -18,7 +18,7 @@ class ContactSendRequest extends FormRequest
'name' => 'required|max:255', 'name' => 'required|max:255',
'email' => 'required|email|max:255', 'email' => 'required|email|max:255',
'content' => 'required|max:2000', 'content' => 'required|max:2000',
'captcha_token' => [new Recaptcha()], // 'captcha_token' => [new Recaptcha()],
]; ];
} }
} }

View File

@@ -15,7 +15,7 @@ class SubscriptionRequest extends BaseRequest
{ {
return [ return [
'email' => 'required|email|unique:subscriptions', 'email' => 'required|email|unique:subscriptions',
'captcha_token' => [new Recaptcha()], // 'captcha_token' => [new Recaptcha()],
]; ];
} }
@@ -28,7 +28,7 @@ class SubscriptionRequest extends BaseRequest
{ {
return [ return [
'email' => 'required|email', 'email' => 'required|email',
'captcha_token' => [new Recaptcha()], // 'captcha_token' => [new Recaptcha()],
]; ];
} }

View File

@@ -16,7 +16,7 @@ class UserForgotPasswordRequest extends FormRequest
{ {
return [ return [
'username' => 'required|exists:users,username', 'username' => 'required|exists:users,username',
'captcha_token' => [new Recaptcha()], // 'captcha_token' => [new Recaptcha()],
]; ];
} }
} }

View File

@@ -16,7 +16,7 @@ class UserForgotUsernameRequest extends FormRequest
{ {
return [ return [
'email' => 'required|email|max:255', 'email' => 'required|email|max:255',
'captcha_token' => [new Recaptcha()], // 'captcha_token' => [new Recaptcha()],
]; ];
} }
} }

View File

@@ -16,7 +16,7 @@ class UserResendVerifyEmailRequest extends FormRequest
{ {
return [ return [
'username' => 'required|exists:users,username', 'username' => 'required|exists:users,username',
'captcha_token' => [new Recaptcha()], // 'captcha_token' => [new Recaptcha()],
]; ];
} }
} }

View File

@@ -17,7 +17,7 @@ class UserResetPasswordRequest extends FormRequest
return [ return [
'code' => 'required|digits:6', 'code' => 'required|digits:6',
'password' => 'required|string|min:8', 'password' => 'required|string|min:8',
'captcha_token' => [new Recaptcha()], // 'captcha_token' => [new Recaptcha()],
]; ];
} }
} }

View File

@@ -16,7 +16,7 @@ class UserVerifyEmailRequest extends FormRequest
{ {
return [ return [
'code' => 'required|digits:6', 'code' => 'required|digits:6',
'captcha_token' => [new Recaptcha()], // 'captcha_token' => [new Recaptcha()],
]; ];
} }
} }

17
package-lock.json generated
View File

@@ -19,7 +19,6 @@
"vue-dompurify-html": "^3.1.2", "vue-dompurify-html": "^3.1.2",
"vue-final-modal": "^3.4.11", "vue-final-modal": "^3.4.11",
"vue-loader": "^17.0.1", "vue-loader": "^17.0.1",
"vue-recaptcha-v3": "^2.0.1",
"vue-router": "^4.1.6", "vue-router": "^4.1.6",
"vue3-easy-data-table": "^1.5.24" "vue3-easy-data-table": "^1.5.24"
}, },
@@ -3427,11 +3426,6 @@
"node": ">=8.10.0" "node": ">=8.10.0"
} }
}, },
"node_modules/recaptcha-v3": {
"version": "1.10.0",
"resolved": "https://registry.npmjs.org/recaptcha-v3/-/recaptcha-v3-1.10.0.tgz",
"integrity": "sha512-aGTxYSk3FFNKnXeKDbLpgRDRyIHRZNBF5HyaXXAN1Aj4TSyyZvmoAn9CylvpqLV3pYpIQavwc+2rzhNFn5SsLQ=="
},
"node_modules/resolve-from": { "node_modules/resolve-from": {
"version": "4.0.0", "version": "4.0.0",
"resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz",
@@ -4453,17 +4447,6 @@
} }
} }
}, },
"node_modules/vue-recaptcha-v3": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/vue-recaptcha-v3/-/vue-recaptcha-v3-2.0.1.tgz",
"integrity": "sha512-isEDtOfHU4wWRrZZuxciAELtQmPOeEEdicPNa0f1AOyLPy3sCcBEcpFt+FOcO3RQv5unJ3Yn5NlsWtXv9rXqjg==",
"dependencies": {
"recaptcha-v3": "^1.8.0"
},
"peerDependencies": {
"vue": "^3.0.11"
}
},
"node_modules/vue-router": { "node_modules/vue-router": {
"version": "4.1.6", "version": "4.1.6",
"resolved": "https://registry.npmjs.org/vue-router/-/vue-router-4.1.6.tgz", "resolved": "https://registry.npmjs.org/vue-router/-/vue-router-4.1.6.tgz",

View File

@@ -42,7 +42,6 @@
"vue-dompurify-html": "^3.1.2", "vue-dompurify-html": "^3.1.2",
"vue-final-modal": "^3.4.11", "vue-final-modal": "^3.4.11",
"vue-loader": "^17.0.1", "vue-loader": "^17.0.1",
"vue-recaptcha-v3": "^2.0.1",
"vue-router": "^4.1.6", "vue-router": "^4.1.6",
"vue3-easy-data-table": "^1.5.24" "vue3-easy-data-table": "^1.5.24"
} }

View File

@@ -3,7 +3,7 @@ import "normalize.css";
import { createPinia } from "pinia"; import { createPinia } from "pinia";
import piniaPluginPersistedstate from "pinia-plugin-persistedstate"; import piniaPluginPersistedstate from "pinia-plugin-persistedstate";
import { createApp } from "vue"; import { createApp } from "vue";
import { VueReCaptcha } from "vue-recaptcha-v3"; // import { VueReCaptcha } from "vue-recaptcha-v3";
import "../css/app.scss"; import "../css/app.scss";
import "./bootstrap"; import "./bootstrap";
import SMColumn from "./components/SMColumn.vue"; import SMColumn from "./components/SMColumn.vue";
@@ -19,12 +19,12 @@ pinia.use(piniaPluginPersistedstate);
createApp(App) createApp(App)
.use(pinia) .use(pinia)
.use(Router) .use(Router)
.use(VueReCaptcha, { // .use(VueReCaptcha, {
siteKey: import.meta.env.GOOGLE_RECAPTCHA_SITE_KEY, // siteKey: import.meta.env.GOOGLE_RECAPTCHA_SITE_KEY,
loaderOptions: { // loaderOptions: {
autoHideBadge: true, // autoHideBadge: true,
}, // },
}) // })
.component("SMContainer", SMContainer) .component("SMContainer", SMContainer)
.component("SMRow", SMRow) .component("SMRow", SMRow)
.component("SMColumn", SMColumn) .component("SMColumn", SMColumn)

View File

@@ -41,7 +41,7 @@
<script setup lang="ts"> <script setup lang="ts">
import { reactive, ref } from "vue"; import { reactive, ref } from "vue";
import { useReCaptcha } from "vue-recaptcha-v3"; // import { useReCaptcha } from "vue-recaptcha-v3";
import { useRoute } from "vue-router"; import { useRoute } from "vue-router";
import SMButton from "../components/SMButton.vue"; import SMButton from "../components/SMButton.vue";
import SMFormCard from "../components/SMFormCard.vue"; import SMFormCard from "../components/SMFormCard.vue";
@@ -52,7 +52,7 @@ import { api } from "../helpers/api";
import { Form, FormControl } from "../helpers/form"; import { Form, FormControl } from "../helpers/form";
import { And, Max, Min, Required } from "../helpers/validate"; import { And, Max, Min, Required } from "../helpers/validate";
const { executeRecaptcha, recaptchaLoaded } = useReCaptcha(); // const { executeRecaptcha, recaptchaLoaded } = useReCaptcha();
const formDone = ref(false); const formDone = ref(false);
let form = reactive( let form = reactive(
Form({ Form({
@@ -64,14 +64,14 @@ const handleSubmit = async () => {
form.loading(true); form.loading(true);
try { try {
await recaptchaLoaded(); // await recaptchaLoaded();
const captcha = await executeRecaptcha("submit"); // const captcha = await executeRecaptcha("submit");
await api.post({ await api.post({
url: "/users/verifyEmail", url: "/users/verifyEmail",
body: { body: {
code: form.controls.code.value, code: form.controls.code.value,
captcha_token: captcha, // captcha_token: captcha,
}, },
}); });

View File

@@ -48,7 +48,7 @@
<script setup lang="ts"> <script setup lang="ts">
import { reactive, ref } from "vue"; import { reactive, ref } from "vue";
import { useReCaptcha } from "vue-recaptcha-v3"; // import { useReCaptcha } from "vue-recaptcha-v3";
import SMButton from "../components/SMButton.vue"; import SMButton from "../components/SMButton.vue";
import SMFormCard from "../components/SMFormCard.vue"; import SMFormCard from "../components/SMFormCard.vue";
import SMForm from "../components/SMForm.vue"; import SMForm from "../components/SMForm.vue";
@@ -58,7 +58,7 @@ import { api } from "../helpers/api";
import { Form, FormControl } from "../helpers/form"; import { Form, FormControl } from "../helpers/form";
import { And, Min, Required } from "../helpers/validate"; import { And, Min, Required } from "../helpers/validate";
const { executeRecaptcha, recaptchaLoaded } = useReCaptcha(); // const { executeRecaptcha, recaptchaLoaded } = useReCaptcha();
const formDone = ref(false); const formDone = ref(false);
let form = reactive( let form = reactive(
Form({ Form({
@@ -70,14 +70,14 @@ const handleSubmit = async () => {
form.loading(true); form.loading(true);
try { try {
await recaptchaLoaded(); // await recaptchaLoaded();
const captcha = await executeRecaptcha("submit"); // const captcha = await executeRecaptcha("submit");
await api.post({ await api.post({
url: "/users/forgotPassword", url: "/users/forgotPassword",
body: { body: {
username: form.controls.username.value, username: form.controls.username.value,
captcha_token: captcha, // captcha_token: captcha,
}, },
}); });

View File

@@ -47,7 +47,7 @@
<script setup lang="ts"> <script setup lang="ts">
import { reactive, ref } from "vue"; import { reactive, ref } from "vue";
import { useReCaptcha } from "vue-recaptcha-v3"; // import { useReCaptcha } from "vue-recaptcha-v3";
import SMButton from "../components/SMButton.vue"; import SMButton from "../components/SMButton.vue";
import SMFormCard from "../components/SMFormCard.vue"; import SMFormCard from "../components/SMFormCard.vue";
import SMForm from "../components/SMForm.vue"; import SMForm from "../components/SMForm.vue";
@@ -57,7 +57,7 @@ import { api } from "../helpers/api";
import { Form, FormControl } from "../helpers/form"; import { Form, FormControl } from "../helpers/form";
import { And, Email, Required } from "../helpers/validate"; import { And, Email, Required } from "../helpers/validate";
const { executeRecaptcha, recaptchaLoaded } = useReCaptcha(); // const { executeRecaptcha, recaptchaLoaded } = useReCaptcha();
const formDone = ref(false); const formDone = ref(false);
let form = reactive( let form = reactive(
Form({ Form({
@@ -69,14 +69,14 @@ const handleSubmit = async () => {
form.loading(true); form.loading(true);
try { try {
await recaptchaLoaded(); // await recaptchaLoaded();
const captcha = await executeRecaptcha("submit"); // const captcha = await executeRecaptcha("submit");
await api.post({ await api.post({
url: "/users/forgotUsername", url: "/users/forgotUsername",
body: { body: {
email: form.controls.email.value, email: form.controls.email.value,
captcha_token: captcha, // captcha_token: captcha,
}, },
}); });

View File

@@ -67,7 +67,7 @@
<script setup lang="ts"> <script setup lang="ts">
import { reactive, ref } from "vue"; import { reactive, ref } from "vue";
import { useReCaptcha } from "vue-recaptcha-v3"; // import { useReCaptcha } from "vue-recaptcha-v3";
import SMButton from "../components/SMButton.vue"; import SMButton from "../components/SMButton.vue";
import SMFormCard from "../components/SMFormCard.vue"; import SMFormCard from "../components/SMFormCard.vue";
import SMForm from "../components/SMForm.vue"; import SMForm from "../components/SMForm.vue";
@@ -84,7 +84,7 @@ import {
Required, Required,
} from "../helpers/validate"; } from "../helpers/validate";
const { executeRecaptcha, recaptchaLoaded } = useReCaptcha(); // const { executeRecaptcha, recaptchaLoaded } = useReCaptcha();
let abortController: AbortController | null = null; let abortController: AbortController | null = null;
const checkUsername = async (value: string): Promise<boolean | string> => { const checkUsername = async (value: string): Promise<boolean | string> => {
@@ -133,8 +133,8 @@ const handleSubmit = async () => {
form.loading(true); form.loading(true);
try { try {
await recaptchaLoaded(); // await recaptchaLoaded();
const captcha = await executeRecaptcha("submit"); // const captcha = await executeRecaptcha("submit");
await api.post({ await api.post({
url: "/register", url: "/register",
@@ -146,7 +146,7 @@ const handleSubmit = async () => {
username: form.controls.username.value, username: form.controls.username.value,
password: form.controls.password.value, password: form.controls.password.value,
display_name: form.controls.username.value, display_name: form.controls.username.value,
captcha_token: captcha, // captcha_token: captcha,
}, },
}); });

View File

@@ -44,7 +44,7 @@
<script setup lang="ts"> <script setup lang="ts">
import { reactive, ref } from "vue"; import { reactive, ref } from "vue";
import { useReCaptcha } from "vue-recaptcha-v3"; // import { useReCaptcha } from "vue-recaptcha-v3";
import SMButton from "../components/SMButton.vue"; import SMButton from "../components/SMButton.vue";
import SMFormCard from "../components/SMFormCard.vue"; import SMFormCard from "../components/SMFormCard.vue";
import SMForm from "../components/SMForm.vue"; import SMForm from "../components/SMForm.vue";
@@ -54,7 +54,7 @@ import { api } from "../helpers/api";
import { Form, FormControl } from "../helpers/form"; import { Form, FormControl } from "../helpers/form";
import { Required } from "../helpers/validate"; import { Required } from "../helpers/validate";
const { executeRecaptcha, recaptchaLoaded } = useReCaptcha(); // const { executeRecaptcha, recaptchaLoaded } = useReCaptcha();
const formDone = ref(false); const formDone = ref(false);
let form = reactive( let form = reactive(
Form({ Form({
@@ -66,14 +66,14 @@ const handleSubmit = async () => {
form.loading(true); form.loading(true);
try { try {
await recaptchaLoaded(); // await recaptchaLoaded();
const captcha = await executeRecaptcha("submit"); // const captcha = await executeRecaptcha("submit");
await api.post({ await api.post({
url: "/users/resendVerifyEmailCode", url: "/users/resendVerifyEmailCode",
body: { body: {
username: form.controls.username.value, username: form.controls.username.value,
captcha_token: captcha, // captcha_token: captcha,
}, },
}); });

View File

@@ -43,7 +43,7 @@
<script setup lang="ts"> <script setup lang="ts">
import { reactive, ref } from "vue"; import { reactive, ref } from "vue";
import { useReCaptcha } from "vue-recaptcha-v3"; // import { useReCaptcha } from "vue-recaptcha-v3";
import { useRoute } from "vue-router"; import { useRoute } from "vue-router";
import SMButton from "../components/SMButton.vue"; import SMButton from "../components/SMButton.vue";
import SMFormCard from "../components/SMFormCard.vue"; import SMFormCard from "../components/SMFormCard.vue";
@@ -54,7 +54,7 @@ import { api } from "../helpers/api";
import { Form, FormControl } from "../helpers/form"; import { Form, FormControl } from "../helpers/form";
import { And, Max, Min, Password, Required } from "../helpers/validate"; import { And, Max, Min, Password, Required } from "../helpers/validate";
const { executeRecaptcha, recaptchaLoaded } = useReCaptcha(); // const { executeRecaptcha, recaptchaLoaded } = useReCaptcha();
const formDone = ref(false); const formDone = ref(false);
let form = reactive( let form = reactive(
Form({ Form({
@@ -76,15 +76,15 @@ const handleSubmit = async () => {
form.loading(true); form.loading(true);
try { try {
await recaptchaLoaded(); // await recaptchaLoaded();
const captcha = await executeRecaptcha("submit"); // const captcha = await executeRecaptcha("submit");
await api.post({ await api.post({
url: "/users/resetPassword", url: "/users/resetPassword",
body: { body: {
code: form.controls.code.value, code: form.controls.code.value,
password: form.controls.password.value, password: form.controls.password.value,
captcha_token: captcha, // captcha_token: captcha,
}, },
}); });