Skip to content

auth_signup_verify_email and recaptcha #878

@benmaesdynapps

Description

@benmaesdynapps

Describe the bug
When the Google ReCaptcha feature (standard Odoo website configuration) is enabled, the passwordless signup flow provided by auth_signup_verify_email fails.

The controller passwordless_signup passes the entire values dictionary (which contains the form data, including recaptcha_token_response) directly to sudo_users.signup. Because recaptcha_token_response is not a valid field on the res.users model, the Odoo ORM raises a ValueError, resulting in a 500 Internal Server Error.

To Reproduce
Affected versions: Odoo 18 (possibly all others)

Steps to reproduce the behavior:

Install auth_signup_verify_email.

Enable "reCAPTCHA" in General Settings (requires valid Site Key and Secret Key).

Go to the website signup page.

Attempt to sign up using the flow provided by this module.

Check the server logs.

Expected behavior
The signup process should complete successfully. The module should either filter out the recaptcha_token_response from the values dictionary before passing it to the signup method, or handle the ReCaptcha verification separately before user creation.

Log / Traceback

Python

File "/opt/odoo/parts/oca/server-auth/auth_signup_verify_email/controllers/main.py", line 56, in passwordless_signup
sudo_users.signup(values, qcontext.get("token"))
File "/opt/odoo/parts/odoo/odoo/addons/auth_signup/models/res_users.py", line 101, in signup
self._signup_create_user(values)
File "/opt/odoo/parts/odoo/odoo/addons/website/models/res_users.py", line 62, in _signup_create_user
new_user = super(ResUsers, self)._signup_create_user(values)
File "/opt/odoo/parts/odoo/odoo/addons/auth_signup/models/res_users.py", line 117, in _signup_create_user
return self._create_user_from_template(values)
...
File "/opt/odoo/parts/odoo/odoo/addons/auth_signup/models/res_users.py", line 156, in _create_user_from_template
return super()._create_user_from_template(values)
...
ValueError: Invalid field 'recaptcha_token_response' on model 'res.users'
Additional context The issue is located in controllers/main.py. The values dictionary captures all params from the request. When ReCaptcha is active, the frontend sends recaptcha_token_response.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions