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

Multisite/network configurations use your current blog as the default… #364

Merged

Conversation

danc1248
Copy link
Contributor

@danc1248 danc1248 commented Jan 7, 2022

Multisite/network configurations use your current blog as the default when using the WP_User_Query which means if a user already exists, from a different blog, you will not find them, but also can't create a new account because they already exist. This overrides your current blog and will search 'all'

All Submissions:

Changes proposed in this Pull Request:

Closes #176.

How to test the changes in this Pull Request:

  1. Using a multi-site configuration with two different clients:
  2. Login to site A with a new user - the user is created successfully
  3. Logout and login to site B. The user is not found but it will fail to create a new user with error "failed-user-creation". The original error is "existing_user_email"
  4. With the code changes the user will be found on site B and you will login successfully

Other information:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes, as applicable?
  • Have you successfully run tests with your changes locally?

Changelog entry

Enter a summary of all changes on this Pull Request. This will appear in the changelog if accepted.

get_user_by_identity uses the current site as the default when searching for a user. This fails to find existing users on a multi-site / network setup. By passing 'blog_id' => 0, it searches all sites.

… when using the WP_User_Query which means if a user already exists, from a different blog, you will not find them, but also can't create a new account because they already exist. This overrides your current blog and will search 'all'
@timnolte timnolte self-assigned this Feb 25, 2022
@timnolte timnolte added bug status: approved PRs that have been approved and ready to be merged. labels Feb 25, 2022
@timnolte timnolte modified the milestones: 3.8.6, 3.9.0 Feb 25, 2022
@timnolte timnolte added this to To do in 3.9.0 Release Feb 25, 2022
@timnolte timnolte merged commit dba533f into oidc-wp:dev Feb 25, 2022
@timnolte timnolte moved this from To do to Done in 3.9.0 Release Feb 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug status: approved PRs that have been approved and ready to be merged.
Projects
No open projects
3.9.0 Release
  
Done
Development

Successfully merging this pull request may close these issues.

On multisite, plugin tries to create user even if exists on other site.
2 participants