Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at

  • Paul 179 posts 620 karma points
    Jun 30, 2022 @ 18:17

    Umbraco Forms - ReCaptcha not working?


    I'm having trouble getting either v2 or v3 of recaptcha working on my V9 site. Umb 9.5.2 and Forms 9.4.2. I keep getting a message saying:

    The Google reCAPTCHA failed to validate your submission.

    I've got @using Umbraco.Forms.Web and @Html.RenderUmbracoFormDependencies() in my master.

    My render call is as such (sat in a View Comp which I'm using as a block so editors can pick a form and drop it on to a page):

     @if (Model.SelectForm != null)
                @(await Component.InvokeAsync("RenderForm",new { formId = Model.SelectForm.Value, recordId = Guid.Empty, theme = "my-custom-style", includeScripts = false }))

    I've got the keys in my appsettings.json and can see they're getting picked up correctly by the ReCaptcha fieldtype.

    I have noticed that when I add ReCaptcha V2 in the my form (within Umb Forms in the backoffice) it lists it as "reCAPTCHA v2" and then says "Google reCAPTCHA v3." under it?

    Everything works bar ReCaptcha. Any ideas folks?

    I can see this in my TraceLog; but it makes no sense, the key is there!

    {"@t":"2022-06-30T15:53:11.7917938Z","@mt":"The secret key for reCAPTCHA v3 is missing, please update UmbracoForms.config to include the 'RecaptchaV3PrivateKey'","@l":"Warning","SourceContext":"Umbraco.Forms.Core.Providers.FieldTypes.Recaptcha3","ActionId":"3cd8937c-e017-4575-a19b-c2ab930e532b","ActionName":"Umbraco.Forms.Web.Controllers.UmbracoFormsController.HandleForm (Umbraco.Forms.Web)","RequestId":"80000082-0000-e200-b63f-84710c7967bb","RequestPath":"/latest/sign-up/","ProcessId":20812"}
  • Paul 179 posts 620 karma points
    Jun 30, 2022 @ 19:23

    After battling this for what seems like hours (well about 4 of them!) I've got it working.

    Just needed to remove , includeScripts = false from the end of the render call (nothing to do with secret keys missing etc)

    It's always the simple things isn't it!

Please Sign in or register to post replies

Write your reply to: