feat: add /external/api/send_mail for body verify (#202)

This commit is contained in:
Dream Hunter
2024-05-04 23:52:06 +08:00
committed by GitHub
parent 869bf99340
commit 41bed8b1db
5 changed files with 46 additions and 6 deletions

View File

@@ -134,6 +134,9 @@ export const checkCfTurnstile = async (c, token) => {
if (!c.env.CF_TURNSTILE_SITE_KEY) {
return;
}
if (!token) {
throw new Error("Captcha token is required");
}
const reqIp = c.req.raw.headers.get("cf-connecting-ip")
let formData = new FormData();
formData.append('secret', c.env.CF_TURNSTILE_SECRET_KEY);