[FIX] google_recaptcha: take argument 'action' into effect

Take argument _action_ of method _verify_request_recaptcha_token into effect.
Otherwise it always sends 'website_form' as recaptcha action to google
recaptcha service to verify the token, this would lead to failure.

closes odoo/odoo#60854

X-original-commit: f29a625857128617c2d4d795e648d5ad1f7ab8a4
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
This commit is contained in:
LiLEE
2020-10-27 16:23:20 +00:00
parent 691c14c070
commit 5b79e43ef0
+1 -1
View File
@@ -21,7 +21,7 @@ class Http(models.AbstractModel):
"""
ip_addr = request.httprequest.remote_addr
token = request.params.pop('recaptcha_token_response', False)
recaptcha_result = request.env['ir.http']._verify_recaptcha_token(ip_addr, token, 'website_form')
recaptcha_result = request.env['ir.http']._verify_recaptcha_token(ip_addr, token, action)
if recaptcha_result in ['is_human', 'no_secret']:
return True
if recaptcha_result == 'wrong_secret':