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

Add mu-plugin that disables Jetpack Protect on the fly to enable auto-login #658

Merged
merged 1 commit into from
Nov 15, 2024

Conversation

wojtekn
Copy link
Contributor

@wojtekn wojtekn commented Nov 13, 2024

Related issues

Proposed Changes

I propose adding an mu-plugin that deactivates Jetpack Protect on the fly to avoid showing math questions in the login form.

Before the change, it prevented users from using "WP Admin" auto-login on local sites that have Jetpack installed. When users used "WP Admin", it showed the login form with the math question:

Screenshot 2024-11-13 at 13 45 10

The expected behavior is to get the user automatically logged in to WP Admin, regardless of whether Jetpack is installed.

Testing Instructions

  1. Export a site that includes the Jetpack plugin, for example:
  • from Activity Log for WoA site
  • from Local dev env after installing the Jetpack plugin there
  1. Import the site to Studio
  2. Open the "WP Admin" link in Studio
  3. Confirm that you were logged to WP Admin automatically

Pre-merge Checklist

  • Have you checked for TypeScript, React or other console errors?

@wojtekn wojtekn requested a review from a team November 13, 2024 12:44
@wojtekn wojtekn self-assigned this Nov 13, 2024
@nightnei
Copy link
Contributor

nightnei commented Nov 14, 2024

@wojtekn I am not familiar with this process yet, could you please add more details for:

  1. Export site that includes Jetpack plugin
  2. Open WP Admin link and confirm that auto-login works - what does it mean Open WP Admin link?

@wojtekn
Copy link
Contributor Author

wojtekn commented Nov 14, 2024

@nightnei I've updated steps with more details, as well as the issue description.

Copy link
Contributor

@katinthehatsite katinthehatsite left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes worked as expected for me 👍

I compared the login with the trunk and was able to auto-login on this branch while on trunk, I got an extra login screen.

Copy link
Contributor

@nightnei nightnei left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works as expected - in trunk I got login screen, but in this branch I was automatically authorized 👍

@wojtekn
Copy link
Contributor Author

wojtekn commented Nov 15, 2024

Thanks for review @katinthehatsite and @nightnei .

@wojtekn wojtekn merged commit cb013c4 into trunk Nov 15, 2024
17 checks passed
@wojtekn wojtekn deleted the fix/auto-login-when-jetpack-is-installed branch November 15, 2024 12:26
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.

3 participants