Code Duplication    Length = 10-12 lines in 2 locations

modules/sso.php 2 locations

@@ 394-405 (lines=12) @@
391
		 * to the WordPress.com login page AND  that the request to wp-login.php
392
		 * is not something other than login (Like logout!)
393
		 */
394
		if (
395
			$this->wants_to_login()
396
			&& Jetpack_SSO_Helpers::bypass_login_forward_wpcom()
397
		) {
398
			add_filter( 'allowed_redirect_hosts', array( 'Jetpack_SSO_Helpers', 'allowed_redirect_hosts' ) );
399
			$this->maybe_save_cookie_redirect();
400
			$reauth = ! empty( $_GET['force_reauth'] );
401
			$sso_url = $this->get_sso_url_or_die( $reauth );
402
			JetpackTracking::record_user_event( 'sso_login_redirect_bypass_success' );
403
			wp_safe_redirect( $sso_url );
404
			exit;
405
		}
406
407
		if ( 'login' === $action ) {
408
			$this->display_sso_login_form();
@@ 419-428 (lines=10) @@
416
						'error_message' => 'identity_crisis'
417
					) );
418
					add_filter( 'login_message', array( $this, 'error_msg_identity_crisis' ) );
419
				} else {
420
					$this->maybe_save_cookie_redirect();
421
					// Is it wiser to just use wp_redirect than do this runaround to wp_safe_redirect?
422
					add_filter( 'allowed_redirect_hosts', array( 'Jetpack_SSO_Helpers', 'allowed_redirect_hosts' ) );
423
					$reauth = ! empty( $_GET['force_reauth'] );
424
					$sso_url = $this->get_sso_url_or_die( $reauth );
425
					JetpackTracking::record_user_event( 'sso_login_redirect_success' );
426
					wp_safe_redirect( $sso_url );
427
					exit;
428
				}
429
			}
430
		}
431
	}