Notification: Provide login to WordPress.com link if not logged in
If the user is not logged into WordPress.com when logged into the local Jetpack site, clicking on the Notifications bubble loads a "loading spinner" that will never resolve, since they aren't logged into WP.com.
If login cookie isn't present, we should provide a link to login to WP.com (or load a login form directly?).
An iframe to login directly would be great!
An iframe to log in may not be great, from a security perspective. We'd need to think about how an exploiter could reskin it to trick them into logging in to their wpcom account. cc: @mdawaffe
Not excited about an iframe. A popup is OK, though, like we do for logged-out likes, the REST API follow button, etc.
How would it feel if we simply displayed a message that said something like the following?
"Notifications are only available when logged into WordPress.com. Please login with those credentials in order to see all the things."
ping @kraftbj @georgestephanis @mdawaffe @blobaugh
Where do they log in?
I would imagine they would click "login with those credentials" and get the pop-up
This came up in 2142489-t
Confirming problem: The notes panel attempts to make the REST API call without sending the valid token, thus the response sends an "Authentication Required" message with a 200 code, so no error reported by the browser.
Ideas from conversation in Slack:
- Check for the presence of the cookie
- Check in WordPress.com and pass over user info via xmlrpc with the rest of
wpcom.getUser() - Send notifications data over to Jetpack and display locally instead of in an iframe from WordPress.com
Right now, since the notifications popup appears in the admin bar for everyone, folks can see their wp.com notifs without having their local account linked to JP.
Long-term, I think it makes sense to have the bubble used for the linked account to reduce confusion (people weirded out b/c their super-secret blog wp.com account's notifs were showing up in their work JP powered admin bar), but noting that this is a sizable UX change from current.
Perhaps, if linked user, display that account's notifs (using either the existing token from JP or one passed down) and if not linked, show via the cookie? Or is that just adding more confusion? Linked user alone?
Also encountered this in 2622445-t
Would be very nice to at least show a friendly message.
A couple of details to help clarify:
If you are only logged into Jetpack, you'll see the notifications toolbar icon:

if you click it, you'll see:

and can note a 403 error in the console:

The other variation of the toolbar (core toolbar, with notifications icon) looks like this:

and shows the same panel + spinner if you're not logged into WP.com.
A button to login would be nice as a short term measure.
Longer term I would love to do more to group together SSO, the WordPress.com toolbar, WordPress.com, and the remote site. That would preclude this scenario from happening. If you are logged into one you're logged into the other.
This issue persists as of Jetpack 7.8. Also tested with 7.9-alpha
This issue has come up again in internal testing: p8oabR-QB-p2#comment-6211.
Removing the notifications icon completely for users who aren't connected to WordPress.com could also work.