From aaf91d4c3798c3310450cc283b9159920b0fdb00 Mon Sep 17 00:00:00 2001 From: superolegatron Date: Sun, 15 Sep 2024 21:40:10 +0300 Subject: [PATCH] moved url for captcha verification to env --- BackEnd/forum/settings.py | 1 + BackEnd/validation/validate_recaptcha.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/BackEnd/forum/settings.py b/BackEnd/forum/settings.py index 71bc3ca9..a9c668af 100644 --- a/BackEnd/forum/settings.py +++ b/BackEnd/forum/settings.py @@ -269,6 +269,7 @@ def show_toolbar(request): # ReCaptcha V2 Invisible RECAPTCHA_V2_PRIVATE_KEY = config("RECAPTCHA_V2_PRIVATE_KEY") +RECAPTCHA_URL = config("RECAPTCHA_URL") CONTACTS_INFO = { "email": "craft.forum0@gmail.com", diff --git a/BackEnd/validation/validate_recaptcha.py b/BackEnd/validation/validate_recaptcha.py index 6f0d7a3c..a7ed8222 100644 --- a/BackEnd/validation/validate_recaptcha.py +++ b/BackEnd/validation/validate_recaptcha.py @@ -6,7 +6,7 @@ def verify_recaptcha(token): """ Validates the reCAPTCHA token with Google's API. """ - recaptcha_url = "https://www.google.com/recaptcha/api/siteverify" + recaptcha_url = settings.RECAPTCHA_URL recaptcha_data = { "secret": settings.RECAPTCHA_V2_PRIVATE_KEY, "response": token,