Open Closed

ReCAPTCHAv2 error when using custom Register page #6679


User avatar
0
mattw@agilenova.com created

Hello,

I wanted to improve model validation during user registration (e.g. set a regex for Username). I copied the Register.cshtml into HttpApi.Host/Pages/Account and changed @model to use my custom model. All field validations are working, password complexity is working, reCAPTCHA allows me to click the check box (I'm not a robot) but immediately displays an error: ReCAPTCHA couldn't find user-provided function: (function(){$('#g-recaptcha-response').val(token)})

I am using ReCAPTCHAv2 and the Register.cshtml changes are limited to @model.

_ViewImports.cshtml in the same directory has: @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers @addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI @addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bootstrap @addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bundling @addTagHelper *, Owl.reCAPTCHA

Please let me know if there is anything else I can check.

Thanks, Matt

  • ABP Framework version: v8.0.3
  • UI Type: Angular
  • Database System: EF Core PostgreSQL
  • Tiered (for MVC) or Auth Server Separated (for Angular): no
  • Exception message and full stack trace: *Browser Console Error: ReCAPTCHA couldn't find user-provided function: (function(){$('#g-recaptcha-response').val(token)})
  • Steps to reproduce the issue:
  • Provide custom registration model, use Register.cshtml from commercial source (with @model change)
Markdown supported.
Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)

4 Answer(s)
  • User Avatar
    0
    mattw@agilenova.com created

    A quick update. I am still getting the JS console error listed above, but I am able to register the user now.

    I had originally overridden protected override async Task<IdentityUser> RegisterLocalUserAsync() with the community source code. I just replaced the community source code with the commercial source code (which has captcha support) and am able to register the user. This is the only method that I had to override in class CustomRegisterModel : RegisterModel.

    I am still interested in knowing what is causing the *Browser Console Error: ReCAPTCHA couldn't find user-provided function: (function(){$('#g-recaptcha-response').val(token)}). The Register.cshtml was taken verbatim from commercial source and only the @model was updated.

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    liangshiwei created
    Fullstack Developer

    Provide custom registration model, use Register.cshtml from commercial source (with @model change)

    Could you share your code?

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    mattw@agilenova.com created

    Can I post ABP commercial source code here or should I email?

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    liangshiwei created
    Fullstack Developer

    Hi,

    My email is shiwei.liang@volosft.com

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.8.0-preview. Updated on September 16, 2026, 07:12
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.