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

ReCAPTCHA couldn't find user-provided function: Functions.recaptchaCallback #15435

Closed
marto55555 opened this issue Aug 15, 2019 · 4 comments
Closed
Assignees
Labels
Bug A problem or regression with an existing feature
Projects
Milestone

Comments

@marto55555
Copy link

Describe the bug

It is not possible to log in when ReCaptcha is enabled, as it cannot "find" and execute the login form submit function.

To Reproduce

Steps to reproduce the behavior:

  1. Create an Invisible v2 ReCaptcha from https://www.google.com/recaptcha/admin/
  2. Add $cfg['CaptchaLoginPublicKey'] and $cfg['CaptchaLoginPrivateKey'] to the config.inc.php file with the values from the ReCaptcha website
  3. Open up phpMyAdmin in a browser, enter a username and password and press Go.
  4. The captcha gets executed, but the form submit does not.

Expected behavior

The form should be submitted after completing the captcha.

Server configuration

  • Operating system: Linux Mint 19.2
  • Web server: Apache/2.4.39 (Ubuntu)
  • Database version: libmysql - mysqlnd 5.0.12-dev - 20150407 - $Id: 7cc7cc96e675f6d72e5cf0f267f48e167c2abb23 $
  • PHP version: 7.3.7-2+ubuntu18.04.1+deb.sury.org+1
  • phpMyAdmin version: 5.1.0-dev; also tested with same behavior on 5.0.0-alpha1

Client configuration

  • Browser: Chrome 76; also tested on Firefox 68 with the same result
  • Operating system: Linux Mint 19.2

Additional context

The console outputs the following error:
ReCAPTCHA couldn't find user-provided function: Functions.recaptchaCallback

Additionally, if I manually execute Functions.recaptchaCallback() in the console afterwards, the login works.

@williamdes williamdes added the Bug A problem or regression with an existing feature label Aug 15, 2019
@williamdes williamdes added this to Needs triage in issues via automation Aug 15, 2019
@williamdes
Copy link
Member

@MauricioFauth do you think this could be from one of your changes when renaming functions ?

@williamdes williamdes moved this from Needs triage to High priority in issues Aug 20, 2019
@sdurban
Copy link

sdurban commented Sep 25, 2019

@williamdes The problem here is the callback function is inside a object called Functions and recaptcha can't find it.

If we attach this function to the window global object and change the data-callback the problem is solved.

It's not elegant but it's a problem from captcha side...

Here's the fix:
https://github.com/sdurban/phpmyadmin/commit/a4f6b801c28f7bfaaa60fc6a1545b44a79719c80

Like I say it's not elegant..

@williamdes
Copy link
Member

Thanks @sdurban!

It is exactly what I was thinking, the recent refractor broke recaptcha callback

I will try to fix it soon

@williamdes williamdes added this to the 5.0.0 milestone Nov 3, 2019
@williamdes williamdes self-assigned this Dec 16, 2019
@williamdes
Copy link
Member

Reproduced, fixing.
thank you @sdurban and @marto55555 for waiting patiently a so long time

williamdes added a commit that referenced this issue Dec 16, 2019
Signed-off-by: William Desportes <williamdes@wdes.fr>
issues automation moved this from High priority to Closed Dec 16, 2019
williamdes added a commit that referenced this issue Dec 16, 2019
Signed-off-by: William Desportes <williamdes@wdes.fr>
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug A problem or regression with an existing feature
Projects
issues
  
Closed
Development

No branches or pull requests

3 participants