Security News
New axobject-query Maintainer Faces Backlash Over Controversial Decision to Support Legacy Node.js Versions
A JavaScript library maintainer is under fire after merging a controversial PR to support legacy versions of Node.js.
reflex-google-recaptcha-v2
Advanced tools
Readme
A Reflex custom component google-recaptcha-v2.
pip install reflex-google-recaptcha-v2
Set your site key and secret key in your environment variables.
export RECAPTCHA_SITE_KEY="your-site-key"
export RECAPTCHA_SECRET_KEY="your-secret-key"
Alternatively, you can set the keys via python functions as seen in the demo app.
import reflex as rx
from reflex_google_recaptcha_v2 import google_recaptcha_v2
def index():
return rx.vstack(
...,
google_recaptcha_v2(),
)
Before taking actions on the backend, you should verify that the user browser has passed validation of the token.
This value will be set for the specific tab that has completed validation and persists for the lifetime of the Reflex session (until the tab is closed).
import reflex as rx
from reflex_google_recaptcha_v2 import GoogleRecaptchaV2State
class MyState(rx.State):
form_error: str
async def handle_submit(self, form_data):
...
recaptcha_state = await self.get_state(GoogleRecaptchaV2State)
if not recaptcha_state.token_is_valid:
self.form_error = "Invalid recaptcha. Are you a robot?"
return
FAQs
Google ReCAPTCHA v2 Integration
We found that reflex-google-recaptcha-v2 demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
A JavaScript library maintainer is under fire after merging a controversial PR to support legacy versions of Node.js.
Security News
Results from the 2023 State of JavaScript Survey highlight key trends, including Vite's dominance, rising TypeScript adoption, and the enduring popularity of React. Discover more insights on developer preferences and technology usage.
Security News
The US Justice Department has penalized two consulting firms $11.3 million for failing to meet cybersecurity requirements on federally funded projects, emphasizing strict enforcement to protect sensitive government data.