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
Redirect authenticated users from splash to dashboard #2529
Comments
@felixarntz after digging into this a little with @asvinb it seems that this only happens when navigating to the splash screen directly once Site Kit is already set up. The title shown on the splash screen on the initial set up is consistent with other Site Kit screens for both primary and secondary users. The problem is related to how WP derives the page title which seems to depend on the page having a |
@aaemnnosttv Ah, that makes sense. I'll deprioritize this for now, but still worth fixing in principle. |
I tracked this down to, as @aaemnnosttv said, a bug/issue with Wordpress where title of the page is not set if the parent slug passed to I found a solution and have added an IB. |
The IB is pretty close, with a few things to iterate on:
|
@aaemnnosttv @felixarntz I have a question: why do we add the splash screen page when the user already has permissions? What's the point to have it? I think if the user already has permissions, we should redirect them to the dashboard page instead of showing the splash screen again and confuse users. What do you think? |
@eugene-manuilov – users shouldn't really land on this page in this state unless they navigated directly to it (from browser history perhaps?). I have found it useful to test things before by being able to navigate directly to it without disconnecting first, but I don't know if that is reason enough to keep this. I agree that the issue as-is does not fix the the root cause, so a redirect to the dashboard would likely be a better experience. As mentioned previously, we already have a redirect in place from the dashboard to the splash page when the user is not authenticated, so we need to make sure this is well-documented and covered with tests to ensure this never results in a circular redirect loop, both now and in the future. @felixarntz – if you agree, let me know and one of us can rewrite the issue/ACs accordingly. |
@aaemnnosttv @eugene-manuilov Redirecting from splash to the dashboard when the user is already authenticated makes sense - let's do that. |
@felixarntz ACs updated + IB which includes moving handlers for connect/disconnect since these don't really belong on the splash URL either and is more consistent with how we're handling other action URLs for proxy setup and settings. |
IB ✅ |
@felixarntz assigning it to you since Evan also wants you to review it. |
QA Update: Pass ✅Unauthenticated / Site Kit not set up yet Authenticated / Site Kit set up
Disconnect via user menu
|
Bug Description
The
googlesitekit-splash
screen currently has an incorrect<title>
tag where the main segment is missing. At the moment it looks like the following:However, there's currently no way for a user to reach the splash screen after they're already authenticated – even the activation notice shown after activating the plugin will link to the dashboard. This makes this situation only possible if the user navigated directly to the splash screen (from browser history/back, etc). The splash screen is only a stepping stone to send the user through Google OAuth; if they're already authenticated, there's no reason to go through it again so they should be sent straight to the dashboard.
If required scopes have changed, the user will still need to go through oAuth of course, but we already prompt the user to "Redo Setup" in this case.
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
googlesitekit-splash
screen should redirect togooglesitekit-dashboard
if the user is already authenticated (Authentication::is_authenticated
)action
URLs, like we do for Google Proxy setup/settings URLsImplementation Brief
googlesitekit-splash
to redirect to the dashboard if authenticated (preserving existing logic to ensure permissions first)googlesitekit-splash
URL to dedicatedadmin_action_
URLs:index.php?action=googlesitekit_connect&nonce=...
index.php?action=googlesitekit_disconnect&nonce=...
Test Coverage
Visual Regression Changes
QA Brief
This issue primarily updates the splash screen to redirect the user to the SK dashboard if they're already authenticated and have sufficient permissions.
The following cases should be tested to work (and continue to work) properly
Unauthenticated / Site Kit not set up yet
Authenticated / Site Kit set up
Disconnect via user menu
Secondarily, the URLs used for beginning the oAuth flow (connect) and disconnecting have been updated to use dedicated action URLs. This change should make no difference for the user.
Changelog entry
The text was updated successfully, but these errors were encountered: