Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mcaptcha usage creates javascript error #33658

Closed
CaveManon opened this issue Feb 20, 2025 · 3 comments · Fixed by #33659
Closed

mcaptcha usage creates javascript error #33658

CaveManon opened this issue Feb 20, 2025 · 3 comments · Fixed by #33659
Labels

Comments

@CaveManon
Copy link

Description

When enabling mCaptcha on a site and going to the registration page, the following Javascript error appears
JavaScript promise rejection: r.default is not a function. Open browser console to see more details.

The console points to the following line of code as the problem area:

      // @ts-expect-error
      mCaptcha.default({
        siteKey: {
          instanceUrl: new URL(instanceURL),
          key: siteKey,
        },
      });

with the error being caught (in promise) TypeError: r.default is not a function

Relevant part of app.ini here:

ENABLE_CAPTCHA = true
MCAPTCHA_SITEKEY = ***
MCAPTCHA_SECRET =  ***
CAPTCHA_TYPE = mcaptcha
MCAPTCHA_URL= https:// ***/widget/?sitekey=***

Gitea Version

1.23.3

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

Not relevant; issue is in Web UI.

Screenshots

Image

Git Version

git version 2.39.5

Operating System

Debian 6.1.124-1

How are you running Gitea?

Downloading .deb package using apt from https://packaging.gitlab.io/gitea

Database

PostgreSQL

@wxiaoguang
Copy link
Contributor

-> Fix mCaptcha bug #33659

@wxiaoguang
Copy link
Contributor

There will be a backport fix for 1.23

GiteaBot pushed a commit to GiteaBot/gitea that referenced this issue Feb 20, 2025
wxiaoguang added a commit that referenced this issue Feb 20, 2025
Backport #33659 by wxiaoguang

Fix #33658

Co-authored-by: wxiaoguang <[email protected]>
@wxiaoguang
Copy link
Contributor

The 1.23 nightly (which is a stable release and will be 1.23.5) is ready

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants