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

Delay redirect for logged in users #87704

Open
wants to merge 2 commits into
base: trunk
Choose a base branch
from

Conversation

simison
Copy link
Member

@simison simison commented Feb 21, 2024

We have /log-in/link and /log-in/link/use routes for magic link — the former we changed to delay redirect when user is logged in already in #82366

If you're not logged in, everything works as expected.

Proposed Changes

  • Delay redirect for logged in users

Testing Instructions

  • Be logged in to .com in calypso localhost
  • Open a site where you aren't subscriber, and not logged in. Subscribe.
  • You'll receive magic login link; you need to use PHP urldecode to ungarble the redirect and replace with Calypso localhost version, .e.g: http://calypso.localhost:3000/log-in/link/use?token=
  • Open the link — you should get redirected to the site/blog post where you subscribed from. Previously you were left inside calypso.

Pre-merge Checklist

  • Has the general commit checklist been followed? (PCYsg-hS-p2)
  • https://wpcalypso.wordpress.com/devdocs/docs/testing/index.md for your changes?
  • Have you tested the feature in Simple (P9HQHe-k8-p2), Atomic (P9HQHe-jW-p2), and self-hosted Jetpack sites (PCYsg-g6b-p2)?
  • Have you checked for TypeScript, React or other console errors?
  • Have you used memoizing on expensive computations? More info in Memoizing with create-selector and Using memoizing selectors and Our Approach to Data
  • Have we added the "[Status] String Freeze" label as soon as any new strings were ready for translation (p4TIVU-5Jq-p2)?
  • For changes affecting Jetpack: Have we added the "[Status] Needs Privacy Updates" label if this pull request changes what data or activity we track or use (p4TIVU-aUh-p2)?

Copy link

github-actions bot commented Feb 21, 2024

@simison simison requested a review from pkuliga February 21, 2024 08:57
@matticbot matticbot added the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Feb 21, 2024
@simison simison added [Status] In Progress Login and removed [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. labels Feb 21, 2024
@matticbot matticbot added [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. labels Feb 21, 2024
@matticbot
Copy link
Contributor

matticbot commented Feb 21, 2024

Here is how your PR affects size of JS and CSS bundles shipped to the user's browser:

App Entrypoints (~6 bytes added 📈 [gzipped])

name         parsed_size           gzip_size
entry-login        +44 B  (+0.0%)       +6 B  (+0.0%)

Common code that is always downloaded and parsed every time the app is loaded, no matter which route is used.

Legend

What is parsed and gzip size?

Parsed Size: Uncompressed size of the JS and CSS files. This much code needs to be parsed and stored in memory.
Gzip Size: Compressed size of the JS and CSS files. This much data needs to be downloaded over network.

Generated by performance advisor bot at iscalypsofastyet.com.

@pkuliga pkuliga marked this pull request as ready for review February 28, 2024 13:15
@pkuliga
Copy link
Contributor

pkuliga commented Feb 28, 2024

Getting "Sorry, but the provided signature isn't valid." when opening the modified login link...

@matticbot
Copy link
Contributor

matticbot commented Feb 28, 2024

This PR modifies the release build for the following Calypso Apps:

For info about this notification, see here: PCYsg-OT6-p2

  • wpcom-block-editor

To test WordPress.com changes, run install-plugin.sh $pluginSlug update/magic-login-subscriber-confirm on your sandbox.

@pkuliga
Copy link
Contributor

pkuliga commented Feb 29, 2024

This issue seems related: Automattic/jetpack#35430

Copy link
Contributor

@pkuliga pkuliga left a comment

Choose a reason for hiding this comment

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

Tested it with testing instructions from #82366 and it seems to work.

It needs a little bit of cleanup before merging.

client/login/index.node.js Outdated Show resolved Hide resolved
client/login/index.node.js Outdated Show resolved Hide resolved
@simison
Copy link
Member Author

simison commented Mar 1, 2024

Needs looking into failed test and thorough testing with other flows;

  • jetpack connect
  • wp.com signup
  • wp.com login
  • gravatar login
  • subscriber login for new user, not logged in yet
  • subscriber login for existing users, not logged in yet
  • subscriber login when already logged in wp.com

@simison simison force-pushed the update/magic-login-subscriber-confirm branch from 623c4c5 to b3ada45 Compare March 4, 2024 10:05
@simison simison removed [Status] In Progress [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. labels Mar 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants