Update main.py
Browse files
main.py
CHANGED
@@ -149,7 +149,7 @@ async def register_post(
|
|
149 |
email: str = Form(...),
|
150 |
password: str = Form(...),
|
151 |
confirm_password: str = Form(...),
|
152 |
-
|
153 |
db: Session = Depends(get_db)
|
154 |
):
|
155 |
# Perform reCAPTCHA verification first
|
@@ -159,17 +159,17 @@ async def register_post(
|
|
159 |
|
160 |
# Call the create_assessment function to validate the token
|
161 |
# assessment = await create_assessment( project_id, recaptcha_key, token, recaptcha_action )
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
|
167 |
# Check the assessment result
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
|
174 |
if password != confirm_password:
|
175 |
# Return to the registration page with an error
|
|
|
149 |
email: str = Form(...),
|
150 |
password: str = Form(...),
|
151 |
confirm_password: str = Form(...),
|
152 |
+
# token: str = Form(...), # Add this line to accept the reCAPTCHA token
|
153 |
db: Session = Depends(get_db)
|
154 |
):
|
155 |
# Perform reCAPTCHA verification first
|
|
|
159 |
|
160 |
# Call the create_assessment function to validate the token
|
161 |
# assessment = await create_assessment( project_id, recaptcha_key, token, recaptcha_action )
|
162 |
+
# loop = asyncio.get_running_loop()
|
163 |
+
# assessment = await loop.run_in_executor(
|
164 |
+
# None, create_assessment, project_id, recaptcha_key, token, recaptcha_action
|
165 |
+
# )
|
166 |
|
167 |
# Check the assessment result
|
168 |
+
# if not assessment or assessment.risk_analysis.score < 0.5: # Use an appropriate risk score threshold
|
169 |
+
# return templates.TemplateResponse("register.html", {
|
170 |
+
# "request": request,
|
171 |
+
# "error_message": "Captcha validation failed."
|
172 |
+
# })
|
173 |
|
174 |
if password != confirm_password:
|
175 |
# Return to the registration page with an error
|