Ww0Xt1mAMy31Ofar0GYu8Oab0v2k0uF1XT_zTt5kPU1M8o58sT5OOXCsSxv3nNGxsG8dG4zI=w1060-fcrop64=1,00005a57ffffa5a8-k-c0xffffffff-no-nd-rj (1)

google-reCAPTCHA

Disclaimer: This is an unnoficial library. Google reCAPTCHA is owned by Google, this library is maintained by Security Union LLC.

YEW-reCAPTCHA-v3

TLDR

reCAPTCHA v3 returns a score for each request without user friction. The score is based on interactions with your site and enables you to take an appropriate action for your site. Register reCAPTCHA v3 keys on the reCAPTCHA Admin console.

How to use it?

```rust use glooconsole::log; use yew::prelude::*; use yewrecaptcha_v3::recaptcha::Recaptcha;

const RECAPTCHASITEKEY: &str = std::env!("RECAPTCHASITEKEY");

[function_component(App)]

fn appcomponent() -> Html { let onexecute = Box::new(usestate(|| None)); let lasttoken = Box::new(usestate(|| None)); let onclick = { let onexecute = onexecute.clone(); let lasttoken = lasttoken.clone(); Callback::from(move || { log!("Button clicked"); // Per https://yew.rs/docs/next/concepts/function-components/communication // We need to create a new callback everytime that we want Recaptcha to be executed. let lasttoken = lasttoken.clone(); onexecute.set(Some(Callback::from(move |token| { lasttoken.set(Some(token)); }))); () }) }; let printlasttoken = match &(**lasttoken) { Some(token) => format!("reCAPTCHA token: {}", token), None => "Press the button to get a token, look at the console logs in case that there's an error".tostring() }; html! { <>