The rust library hcaptcha is used with your backend service to verify the hcaptcha response provided from the client.
To use hcaptcha-rs in your project you can add the following to your Cargo.toml
:
toml
[dependencies]
hcaptcha = "2.2.0"
Derive a validation method on the data structure representing your data, marking the captcha components in the data structure.
``` rust
pub struct ContactForm { name: String, phone: String, email: String, message: String, #[captcha] token: String, } ```
Validate the captcha data.
``` rust
# #[tokio::main]
# async main() -> Result<(), Box
```
See the examples folder for an AWS Lambda contact form example.
Licensed under either of
A summary of third party licenses can be found here
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
Initial version based on recaptcha-rs by panicbit.