Skip to content

Multisite Recursion Problem #9

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

Open
lucasstark opened this issue Aug 26, 2014 · 1 comment
Open

Multisite Recursion Problem #9

lucasstark opened this issue Aug 26, 2014 · 1 comment

Comments

@lucasstark
Copy link

There is a problem with recursion when using multisite. The json_basic_auth_handler calls wp_authenticate, which eventually calls the function is_user_spammy, which calls get_currentuserinfo, which fires off the determine_current_user filter again.

To resolve this i've removed the filter and re-added as such:

remove_filter( 'authenticate', 'wp_authenticate_spam_check', 99 );
$user = wp_authenticate( $username, $password );
add_filter( 'authenticate', 'wp_authenticate_spam_check', 99 );
@chrisvanpatten
Copy link

I reported this separately at WP-API issue #508.

The fix above works perfectly. There should probably be some kind of check to make sure the filter is only removed on multisite, but it gets the job done as a quick hack!

mnelson4 pushed a commit to eventespresso/Basic-Auth that referenced this issue Mar 7, 2016
…for multisite because wp_authenticate_spam_check itself does that check
mnelson4 pushed a commit to eventespresso/Basic-Auth that referenced this issue Mar 7, 2016
…for multisite because wp_authenticate_spam_check itself does that check
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

No branches or pull requests

2 participants