Woo JPC: Do not use code token type when trying to magic login #107151
+13
−2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes DOTOBRD-347.
Proposed Changes
The Jetpack connection flow for Woo should always use the magic login through an email link, not a code.
The front-end was forcing the authentication through a magic code (which is not supported on the back-end, hence the empty link reported in the video) using the magic link template because it was not considering Woo JPC (treating every Jetpack connection equally).
This PR changes the token type to
linkinstead ofcodewhen dispatching the front-end request.On a different note, it's weird to me that we need to declare the magic login type on the front end instead of using a back-end condition.
Testing Instructions
https://wordpress.com/jetpack/connect/authorizepage.https://wordpress.com/start/account/user-social?redirect_to=%2Fjetpack%2Fconnect%2Fauthorize), replace the hostname with the Calypso live link from this PR orcalypso.localhost:3000given you're running it locally.