From 2b82af9a0cf949c239c869bad9a288bd711069d0 Mon Sep 17 00:00:00 2001 From: Aravinth Manivannan Date: Fri, 30 Jun 2023 03:20:57 +0530 Subject: [PATCH] feat: update novice captcha creation form to include publish_benchmarks preference --- Cargo.lock | 1 + Cargo.toml | 1 + src/data.rs | 6 +++++- templates/panel/sitekey/add/novice/form.html | 14 +++++++++++++- templates/panel/sitekey/add/novice/ts/form.ts | 10 +++++++--- 5 files changed, 27 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6a6dc121..8cab5bcf 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1724,6 +1724,7 @@ dependencies = [ "tokio", "url", "urlencoding", + "uuid", "validator", ] diff --git a/Cargo.toml b/Cargo.toml index a3ffe7f6..25058093 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -79,6 +79,7 @@ lettre = { version = "0.10.0-rc.3", features = [ ]} openssl = { version = "0.10.48", features = ["vendored"] } +uuid = { version = "1.4.0", features = ["v4", "serde"] } [dependencies.db-core] diff --git a/src/data.rs b/src/data.rs index 4aaf5031..ede9875e 100644 --- a/src/data.rs +++ b/src/data.rs @@ -83,7 +83,11 @@ impl SystemGroup { enum_system_wrapper!(get_pow, String, CaptchaResult>); // utility function to verify [Work] - pub async fn verify_pow(&self, msg: Work, ip: String) -> CaptchaResult { + pub async fn verify_pow( + &self, + msg: Work, + ip: String, + ) -> CaptchaResult<(String, u32)> { match self { Self::Embedded(val) => val.verify_pow(msg, ip).await, Self::Redis(val) => val.verify_pow(msg, ip).await, diff --git a/templates/panel/sitekey/add/novice/form.html b/templates/panel/sitekey/add/novice/form.html index 141fb8bb..c86a73f8 100644 --- a/templates/panel/sitekey/add/novice/form.html +++ b/templates/panel/sitekey/add/novice/form.html @@ -23,6 +23,7 @@ /> +