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

Masterbar: allow logging out of wpcom when logging out of site. #12457

Merged
merged 1 commit into from
May 24, 2019

Conversation

jeherve
Copy link
Member

@jeherve jeherve commented May 23, 2019

Fixes #12456

Changes proposed in this Pull Request:

This change avoids initialiazing all of the Masterbar after admin_bar_init. We want the module to be available after logging out as well, so the function hooked into wp_logout can be triggered.

Testing instructions:

  1. Install and activate the AMP plugin.
  2. Activate the WordPress.com Toolbar feature on your site, under Jetpack > Settings > Writing
  3. Make sure you are logged in with your WordPress.com account.
  4. In the masterbar, click on your gravatar.
  5. Click sign out.
  6. You will be signed out of your site, and should get signed out of WordPress.com as well.
  7. Make sure you get no PHP warnings from the AMP plugin.
  8. Make sure that in AMP views, the Masterbar is not active.

Proposed changelog entry for your changes:

  • Masterbar: Log out of WordPress.com when logging out of site.

Fixes #12456

This change avoids initialiazing all of the Masterbar after admin_bar_init. We want the module to be available after logging out as well, so the function hooked into wp_logout can be triggered.
@jeherve jeherve added [Type] Bug When a feature is broken and / or not performing as intended [Status] Needs Review To request a review from Crew. Label will be renamed soon. [Pri] High [Feature] Masterbar WordPress.com Toolbar and Dashboard customizations labels May 23, 2019
@jeherve jeherve added this to the 7.4 milestone May 23, 2019
@jeherve jeherve requested review from kraftbj and jmdodd May 23, 2019 20:18
@jeherve jeherve requested a review from a team as a code owner May 23, 2019 20:18
@jeherve jeherve self-assigned this May 23, 2019
@jetpackbot
Copy link

Thank you for the great PR description!

When this PR is ready for review, please apply the [Status] Needs Review label. If you are an a11n, please have someone from your team review the code if possible. The Jetpack team will also review this PR and merge it to be included in the next Jetpack release.

Scheduled Jetpack release: June 4, 2019.
Scheduled code freeze: May 28, 2019

Generated by 🚫 dangerJS against 5e07f91

brbrr
brbrr previously requested changes May 24, 2019
Copy link
Contributor

@brbrr brbrr left a comment

Choose a reason for hiding this comment

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

It works well for the first log-out attempt: I got logged out from both WP site and WPCOM. When I tried to log out for the second time, it won't log me out from WPCOM. I tried logging out from both admin pages and a non-amp frontend view

@brbrr brbrr added [Status] Needs Author Reply We would need you to make some changes or provide some more details about your PR. Thank you! and removed [Status] Needs Review To request a review from Crew. Label will be renamed soon. labels May 24, 2019
@jeherve
Copy link
Member Author

jeherve commented May 24, 2019

@brbrr Could you clarify the steps you followed:

  1. You logged out using the Masterbar once.
  2. You logged back into WordPress.com.
  3. In a separate window, you logged back into the site?
  4. At that point, you tried using the Masterbar again to log out, and it only logged out of the site?

Were you using SSO on the site?

@brbrr
Copy link
Contributor

brbrr commented May 24, 2019

Yeah, I should mention that I’ve been using SSO for most of my testing.

The steps are correct, although 2,3 are combined to single step since I used SSO to login

@brbrr
Copy link
Contributor

brbrr commented May 24, 2019

I retested it with SSO enabled and disabled and I can replicate the issue I mentioned above. So logging out via WPCOM masterbar did not logs you out from WPCOM on subsequent attempts

@jeherve
Copy link
Member Author

jeherve commented May 24, 2019

I can't seem to reproduce unfortunately. It always appears to log me out of both instances. :(

@kraftbj Do you think you could give it a try as well?

Copy link
Contributor

@kraftbj kraftbj left a comment

Choose a reason for hiding this comment

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

Huh, good catch @brbrr. I was able the failure on the second attempt both with SSO on and off.

Copy link
Contributor

@kraftbj kraftbj left a comment

Choose a reason for hiding this comment

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

The issue previously reported (unable to log out on a second attempt) still exists; however, confirmed it was present before the bug this PR is trying to fixed was introduced.

I'm approving as this fixes the behavior back to JP 6.9, but we need a new one to fix the second logout issue.

@jeherve jeherve dismissed brbrr’s stale review May 24, 2019 21:19

This seems to be a separate issue from this PR. It existed in previous versions of Jetpack. I logged it in #12465

@jeherve jeherve added [Status] Ready to Merge Go ahead, you can push that green button! and removed [Status] Needs Author Reply We would need you to make some changes or provide some more details about your PR. Thank you! labels May 24, 2019
@jeherve jeherve merged commit 865ea01 into master May 24, 2019
@matticbot matticbot added [Status] Needs Changelog and removed [Status] Ready to Merge Go ahead, you can push that green button! labels May 24, 2019
@jeherve jeherve deleted the fix/masterbar-amp branch May 24, 2019 21:21
jeherve added a commit that referenced this pull request May 24, 2019
jeherve added a commit that referenced this pull request May 27, 2019
* Kick off the changelog

* Add 7.3.1

* Update date and post link

* changelog: add #12219

* changelog: add #12170

* changelog: add #12184

* Changelog: add #12268

* Changelog: add #12081

* Changelog: add #12323

* Changelog: add #12204

* Changelog: add #12269

* Changelog: add #12332

* changelog: add #12339

* changelog: add #12209

* Changelog: add #12319

* Changelog: add #12357

* Changelog: add #12124

* Changelog: add #12373

* Changelog: add #12252

* Changelog: add #12383

* Changelog: add #12372

* changelog: add #12337

* Changelog: add #12290

* Changelog: add #12301

* Changelog: add #12061

* Testing list: add instructions for #12061

* Changelog: add #12393

* Update minimum supported version

See #12287

* Changelog: add #12406

* Testing list: add #12406

* Changelog: add #12277

* Changelog: add #12412

* Changelog: add #11318

* Changelog: add #12328

* Changelog: add #12425

* Changelog: add #12380

* Changelog: add #12428

* Changelog: add #12414

* Changelog: add #12395

* Changelog & Testing list: add #12416, #12417, #12418, and #12348

* changelog: add #12379

* Changelog: add #12341

* changelog: add #12444

* Changelog: add #12434

* Changelog: add #12454

* Changelog: add #12460

* Changelog: add #12463

* Changelog: add #12457

* Changelog / testing list: add #10333

* Changelog: add #12467


Co-authored-by: Jeremy Herve <jeremy@jeremy.hu>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Masterbar WordPress.com Toolbar and Dashboard customizations [Pri] High [Type] Bug When a feature is broken and / or not performing as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Masterbar: logging out of your site does not log you out of WordPress.com
5 participants