Automattic / Automattic/jetpack

Gutenframe: Logging in and out as different users interferes with redirects [8]

Open
#12,336 1 comment 0 reactions 0 assignees View on GitHub
[Feature] Calypsoify [Focus] Blocks [Pri] Low [Status] Auto-allocated Bug Triaged
Dominant language
PHP
Stars
1.8k
Forks
898
Avg merge
1d 18h
Merged PRs (30d)
774

Description

In testing Gutenframe attempts to handle logged out users on the Jetpack side, a few edge cases were discovered that should be addressed.

This tests really well now, with both Atomic and Jetpack sites, and admin and non-admin users (also SSO and without). I was able to find a particular test user of mine that always hits a server (not WP) 401 on a certain v1 Atomic site; however, the same user works on other Atomic sites, and other users work on that Atomic site, so I have no explanation of what edge-case I'm hitting, or if it's an issue non-a11s will see in production. Considering the positive testing of everything else, I wouldn't want it to be a blocker.

I also found an edge case that causes the user to hit [this wall](https://github.com/Automattic/jetpack/blob/master/modules/wpcom-block-editor/class-jetpack-wpcom-block-editor.php#L176):

Screen Shot 2019-05-09 at 11 35 39 AM

If a user:
* is logged in as user A,
* loads the block editor, successfully setting the auth cookies on the Jetpack site,
* then logs out of WordPress.com,
* and back into WordPress.com as user B,
* then loads the same JP site's block editor again,
* the existing cookies for the Jetpack site will be for user A (triggering the mismatch).

See https://github.com/Automattic/jetpack/pull/12215 for details.

Contributor guide

Open the contributing guide

Research direction

Start with modules/wpcom-block-editor/class-jetpack-wpcom-block-editor.php around line 176 and read the linked pull request 12215. Reproduce the sequence of opening the block editor as user A, logging out, logging in as user B, and reopening it; done means the stale Jetpack-site cookies no longer cause the mismatch or redirect wall.

Written by the indexing model from the issue text.

Assessment

Tech stack
php, wordpress
Domain
authentication
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.