From 874cd193e5f9dd9821c16769a76e174a4a1ec137 Mon Sep 17 00:00:00 2001 From: Amauri CHAMPEAUX Date: Wed, 20 Jan 2021 11:59:11 +0100 Subject: [PATCH] Add an option to add an ID on recaptcha --- tarteaucitron.services.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tarteaucitron.services.js b/tarteaucitron.services.js index a6f8ad0..6cbee02 100644 --- a/tarteaucitron.services.js +++ b/tarteaucitron.services.js @@ -1536,7 +1536,13 @@ tarteaucitron.services.recaptcha = { "use strict"; window.tacRecaptchaOnLoad = tarteaucitron.user.recaptchaOnLoad || function() {}; tarteaucitron.fallback(['g-recaptcha'], ''); - tarteaucitron.addScript('https://www.google.com/recaptcha/api.js?onload=tacRecaptchaOnLoad'); + + if (tarteaucitron.user.recaptchaapi === undefined) { + tarteaucitron.addScript('https://www.google.com/recaptcha/api.js?onload=tacRecaptchaOnLoad'); + } else { + tarteaucitron.addScript('https://www.google.com/recaptcha/api.js?onload=tacRecaptchaOnLoad&render=' + tarteaucitron.user.recaptchaapi); + } + }, "fallback": function () { "use strict";