Code Duplication    Length = 8-9 lines in 2 locations

modules/sso.php 2 locations

@@ 384-391 (lines=8) @@
381
			 * to the WordPress.com login page AND  that the request to wp-login.php
382
			 * is not something other than login (Like logout!)
383
			 */
384
			if ( Jetpack_SSO_Helpers::bypass_login_forward_wpcom() ) {
385
				add_filter( 'allowed_redirect_hosts', array( 'Jetpack_SSO_Helpers', 'allowed_redirect_hosts' ) );
386
				$reauth = ! empty( $_GET['force_reauth'] );
387
				$sso_url = $this->get_sso_url_or_die( $reauth );
388
				JetpackTracking::record_user_event( 'sso_login_redirect_bypass_success' );
389
				wp_safe_redirect( $sso_url );
390
				exit;
391
			}
392
393
			$this->display_sso_login_form();
394
@@ 402-410 (lines=9) @@
399
			} else {
400
				if ( Jetpack::is_staging_site() ) {
401
					add_filter( 'login_message', array( 'Jetpack_SSO_Notices', 'sso_not_allowed_in_staging' ) );
402
				} else {
403
					// Is it wiser to just use wp_redirect than do this runaround to wp_safe_redirect?
404
					add_filter( 'allowed_redirect_hosts', array( 'Jetpack_SSO_Helpers', 'allowed_redirect_hosts' ) );
405
					$reauth = ! empty( $_GET['force_reauth'] );
406
					$sso_url = $this->get_sso_url_or_die( $reauth );
407
					JetpackTracking::record_user_event( 'sso_login_redirect_success' );
408
					wp_safe_redirect( $sso_url );
409
					exit;
410
				}
411
			}
412
		}
413
	}