Skip to content

Commit

Permalink
[FIX] auth_signup_verify_email: Use reCaptcha
Browse files Browse the repository at this point in the history
  • Loading branch information
Cl0ut1eR committed Mar 11, 2025
1 parent 68a5523 commit f2b0fa6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion auth_signup_verify_email/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{
"name": "Verify email at signup",
"summary": "Force uninvited users to use a good email for signup",
"version": "17.0.1.0.0",
"version": "17.0.1.0.1",
"category": "Authentication",
"website": "https://github.com/OCA/server-auth",
"author": "Antiun Ingeniería S.L., "
Expand Down
3 changes: 3 additions & 0 deletions auth_signup_verify_email/controllers/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from email_validator import EmailSyntaxError, EmailUndeliverableError, validate_email

from odoo import _
from odoo.exceptions import UserError
from odoo.http import request, route

from odoo.addons.auth_signup.controllers.main import AuthSignupHome
Expand All @@ -26,6 +27,8 @@ def passwordless_signup(self):

# Check good format of e-mail
try:
if not request.env["ir.http"]._verify_request_recaptcha_token("signup"):
raise UserError(_("Suspicious activity detected by Google reCaptcha."))

Check warning on line 31 in auth_signup_verify_email/controllers/main.py

View check run for this annotation

Codecov / codecov/patch

auth_signup_verify_email/controllers/main.py#L31

Added line #L31 was not covered by tests
validate_email(values.get("login", ""))
except EmailSyntaxError as error:
qcontext["error"] = getattr(
Expand Down

0 comments on commit f2b0fa6

Please sign in to comment.