Code Duplication    Length = 11-11 lines in 2 locations

_inc/class.jetpack-provision.php 1 location

@@ 80-90 (lines=11) @@
77
		$auto_enable_sso = ( ! Jetpack::is_active() || Jetpack::is_module_active( 'sso' ) );
78
79
		/** This filter is documented in class.jetpack-cli.php */
80
		if ( apply_filters( 'jetpack_start_enable_sso', $auto_enable_sso ) ) {
81
			$redirect_uri = add_query_arg(
82
				array(
83
					'action'      => 'jetpack-sso',
84
					'redirect_to' => rawurlencode( admin_url() ),
85
				),
86
				wp_login_url() // TODO: come back to Jetpack dashboard?
87
			);
88
		} else {
89
			$redirect_uri = admin_url();
90
		}
91
92
		$request_body = array(
93
			'jp_version'   => JETPACK__VERSION,

class.jetpack-xmlrpc-server.php 1 location

@@ 321-331 (lines=11) @@
318
		$auto_enable_sso = ( ! Jetpack::is_active() || Jetpack::is_module_active( 'sso' ) );
319
320
		/** This filter is documented in class.jetpack-cli.php */
321
		if ( apply_filters( 'jetpack_start_enable_sso', $auto_enable_sso ) ) {
322
			$redirect_uri = add_query_arg(
323
				array(
324
					'action'      => 'jetpack-sso',
325
					'redirect_to' => rawurlencode( admin_url() ),
326
				),
327
				wp_login_url() // TODO: come back to Jetpack dashboard?
328
			);
329
		} else {
330
			$redirect_uri = admin_url();
331
		}
332
333
		// Generate secrets.
334
		$role    = Jetpack::translate_user_to_role( $user );