feat: CAPTCHA session ID

This commit is contained in:
Roi Feng
2025-02-19 22:24:45 -05:00
parent 51df50a72e
commit 12c7473e36
7 changed files with 82 additions and 14 deletions

View File

@ -70,8 +70,9 @@ func CheckMain(w http.ResponseWriter, userRequestData dataType.UserRequest, rule
http.Error(w, "500 - Internal Server Error", http.StatusInternalServerError)
return
}
w.WriteHeader(http.StatusServiceUnavailable)
w.Header().Set("Set-Cookie", "__torii_session_id="+string(decision.ResponseData)+"; Path=/; Max-Age=86400; Priority=High; HttpOnly;")
w.Header().Set("Content-Type", "text/html; charset=utf-8")
w.WriteHeader(http.StatusServiceUnavailable)
if err = tpl.Execute(w, nil); err != nil {
log.Printf("Error template: %v", err)
http.Error(w, "500 - Internal Server Error", http.StatusInternalServerError)