First commit

This commit is contained in:
corrado.mulas
2024-11-20 02:37:15 +01:00
parent 3ed2e3560c
commit 3a9065d37e

View File

@@ -4,11 +4,13 @@ import (
"bytes" "bytes"
"encoding/json" "encoding/json"
"fmt" "fmt"
"log"
"net/http" "net/http"
"os" "os"
) )
func validateRecaptcha(token string) (bool, error) { func validateRecaptcha(token string) (bool, error) {
log.Printf("Validating Turnstile token: %s", token)
secret := os.Getenv("TURNSTILE_SECRET_KEY") secret := os.Getenv("TURNSTILE_SECRET_KEY")
if secret == "" { if secret == "" {
return false, fmt.Errorf("TURNSTILE_SECRET_KEY is not set") return false, fmt.Errorf("TURNSTILE_SECRET_KEY is not set")