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

Guided Tour: Redirect to Login page if logged out #25498

Merged
merged 2 commits into from
Jun 14, 2018

Conversation

mattwiebe
Copy link
Contributor

@mattwiebe mattwiebe commented Jun 14, 2018

EDIT: This PR has been amended to more surgically focused. A framework-wide redirect for all logged-in pages to the login screen should be pursued, but this is tied to a time-sensitive project and I don't have the resources to pursue something on the framework level.

All that will happen now is that if you hit a URL beginning with /stats, you will be redirected to the login page and then back to your original URL on success. This will enable the users who click in their email to the Guided Tour and are logged out to actually enter it.

Original discussion left below for posterity. I will try to open a Framework issue later.


When you hit a valid route as a logged-out user, we should send you to the login page with a redirect back to the page you were trying to access. This is how all wp-admin links in core WP works.

There have been fixes for individual pages (eg #24687) but this should be handled at the framework level. We have an email campaign using the Simple Payments Guided Tour (#24627) and it freezes at a blank screen for a logged-out user, using the path /stats/day/{siteName}/?tour=simplePaymentsEmailTour.

What this change does is to do a redirect for a valid section with the enableLoggedOut property set to true to the login screen with a redirect. A future PR could probably remove all bespoke uses of import { redirectLoggedOut } from 'controller' as well since this should supersede it.

When you hit a valid route as a logged-out user, we should send you to the login page with a redirect back to the page you were trying to access. This is how all wp-admin links in core WP works.

There have been fixes for individual pages (eg #24687 ) but this should be handled at the framework level. We have an email campaign using the Simple Payments Guided Tour #24627 and it freezes at a blank screen for a logged-out user.

What this change does is to do a redirect for a valid section with the `enableLoggedOut` property set to true to the login screen with a redirect. A future PR could probably remove all bespoke uses of `import { redirectLoggedOut } from 'controller'` as well since this should supersede it.
@mattwiebe mattwiebe added [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. [Status] Needs e2e Testing labels Jun 14, 2018
@matticbot
Copy link
Contributor

@mattwiebe mattwiebe requested review from jsnajdr and removed request for jsnajdr June 14, 2018 16:31
@mattwiebe mattwiebe added [Status] In Progress and removed [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. [Status] Needs e2e Testing labels Jun 14, 2018
This is only trying to fix the `stats` route. The previous change broke signup and other critical views that begin logged-out. This will simply fix the Guided Tour.
@mattwiebe mattwiebe added [Status] Needs e2e Testing Stats Everything related to our analytics product at /stats/ Guided Tours [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. and removed Framework [Status] In Progress labels Jun 14, 2018
@mattwiebe mattwiebe requested a review from jsnajdr June 14, 2018 16:48
@mattwiebe mattwiebe changed the title Framework: Redirect to Login page if logged out Guided Tour: Redirect to Login page if logged out Jun 14, 2018
Copy link
Contributor

@blowery blowery left a comment

Choose a reason for hiding this comment

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

LGTM. Redirects to /log-in with the correct path back

@blowery blowery removed [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. [Status] Needs e2e Testing labels Jun 14, 2018
@mattwiebe mattwiebe merged commit 87125bf into master Jun 14, 2018
@mattwiebe mattwiebe deleted the fix/logged-out-redirects branch June 14, 2018 17:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Guided Tours Stats Everything related to our analytics product at /stats/
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants