upd
This commit is contained in:
1 parent
c3dfbdd44b
commit
bf99b542ea
1 file changed
+26
-26
@@ -83,32 +83,32 @@ export const action: ActionFunction = async ({ request }) => {
|
||||
});
|
||||
}
|
||||
} else if (_action === "create") {
|
||||
const response = (await request.formData()).get("cf-turnstile-response");
|
||||
if (!response) {
|
||||
return {
|
||||
error: "No captcha response",
|
||||
};
|
||||
}
|
||||
const verifyEndpoint =
|
||||
"https://challenges.cloudflare.com/turnstile/v0/siteverify";
|
||||
const secret =
|
||||
process.env.TURNSTILE_SECRET || "1x0000000000000000000000000000000AA";
|
||||
const resp = await fetch(verifyEndpoint, {
|
||||
method: "POST",
|
||||
body: JSON.stringify({
|
||||
secret,
|
||||
response,
|
||||
}),
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
});
|
||||
const data = await resp.json();
|
||||
if (!data.success) {
|
||||
return {
|
||||
error: "Failed to verify captcha",
|
||||
};
|
||||
}
|
||||
// const response = (await request.formData()).get("cf-turnstile-response");
|
||||
// if (!response) {
|
||||
// return {
|
||||
// error: "No captcha response",
|
||||
// };
|
||||
// }
|
||||
// const verifyEndpoint =
|
||||
// "https://challenges.cloudflare.com/turnstile/v0/siteverify";
|
||||
// const secret =
|
||||
// process.env.TURNSTILE_SECRET || "1x0000000000000000000000000000000AA";
|
||||
// const resp = await fetch(verifyEndpoint, {
|
||||
// method: "POST",
|
||||
// body: JSON.stringify({
|
||||
// secret,
|
||||
// response,
|
||||
// }),
|
||||
// headers: {
|
||||
// "Content-Type": "application/json",
|
||||
// },
|
||||
// });
|
||||
// const data = await resp.json();
|
||||
// if (!data.success) {
|
||||
// return {
|
||||
// error: "Failed to verify captcha",
|
||||
// };
|
||||
// }
|
||||
|
||||
const domain = process.env.EMAIL_DOMAIN || "";
|
||||
if (!domain) {
|
||||
|
||||
Reference in new issue
Block a user