Skip to content

Fix ultimate member double captcha request when WP login captcha is active as well#49

Merged
gzuidhof merged 1 commit intoFriendlyCaptcha:mainfrom
TheZoker:fix-um
Jun 27, 2022
Merged

Fix ultimate member double captcha request when WP login captcha is active as well#49
gzuidhof merged 1 commit intoFriendlyCaptcha:mainfrom
TheZoker:fix-um

Conversation

@TheZoker
Copy link
Copy Markdown
Contributor

@TheZoker TheZoker commented Jun 24, 2022

I realized, that the UM integration still did not work when the native wordpress login form integration was active as well, so I debugged a little bit.

It seems, that UM integrated with the native wordpress login hook:
https://github.com/ultimatemember/ultimatemember/blob/df4d0c3543d7d22e067fa89f10a32eeec5e9604a/includes/core/um-actions-login.php#L66

which is also triggered here:

add_filter( 'authenticate', 'frcaptcha_wp_login_validate', 20, 3 );

So when UM starts a verification request, this hook will also start another verification request, which leads to captcha errors.
I fixed this by checking, if the request was made by UM or not and in case it was made by UM I ignore it and do not start the second request. Maybe there is a more elegant solution to this, but this works fine.

Update: I found a more elegant solution by removing the filter wordpress login verification filter, when the login request is made by UM. I think this is a much better solution to the issue.

But please test this with wordpress native login and UM login. Thanks!

@TheZoker
Copy link
Copy Markdown
Contributor Author

@gzuidhof Can you please have a look at this? Thanks!

@gzuidhof
Copy link
Copy Markdown
Collaborator

Looks good to me, thank you for the contribution! :)

@gzuidhof gzuidhof merged commit 426652c into FriendlyCaptcha:main Jun 27, 2022
@TheZoker TheZoker deleted the fix-um branch June 27, 2022 11:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants