File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -656,7 +656,10 @@ export default connect(
656656 redirectTo : stateProps . redirectTo ,
657657 loginFormFlow : true ,
658658 showGlobalNotices : false ,
659- ...( shouldUseMagicCode ( { isJetpack : ownProps . isJetpack } ) && { tokenType : 'code' } ) ,
659+ ...( shouldUseMagicCode ( {
660+ isWooJPC : stateProps . isWooJPC ,
661+ isJetpack : ownProps . isJetpack ,
662+ } ) && { tokenType : 'code' } ) ,
660663 source : stateProps . isWooJPC ? 'woo-passwordless-jpc' + '-' + get ( stateProps , 'from' ) : '' ,
661664 flow :
662665 ( ownProps . isJetpack && 'jetpack' ) ||
Original file line number Diff line number Diff line change @@ -5,14 +5,22 @@ type ShouldUseMagicCodeProps = {
55 * Whether the login is for a Jetpack site.
66 */
77 isJetpack ?: boolean ;
8+ /**
9+ * Whether the login is for a Woo Jetpack Connection.
10+ */
11+ isWooJPC ?: boolean ;
812} ;
913
1014/**
1115 * Returns true if the login should use magic code.
1216 * @param {ShouldUseMagicCodeProps } options
1317 * @returns {boolean }
1418 */
15- export function shouldUseMagicCode ( { isJetpack } : ShouldUseMagicCodeProps ) : boolean {
19+ export function shouldUseMagicCode ( { isJetpack, isWooJPC } : ShouldUseMagicCodeProps ) : boolean {
20+ if ( isWooJPC ) {
21+ return false ;
22+ }
23+
1624 const isMagicCodeEnabled = config . isEnabled ( 'login/use-magic-code' ) ;
1725
1826 if ( isJetpack && isMagicCodeEnabled ) {
You can’t perform that action at this time.
0 commit comments