Code Duplication    Length = 11-11 lines in 2 locations

_inc/class.jetpack-provision.php 1 location

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

class.jetpack-xmlrpc-server.php 1 location

@@ 250-260 (lines=11) @@
247
		$auto_enable_sso = ( ! Jetpack::is_active() || Jetpack::is_module_active( 'sso' ) );
248
249
		/** This filter is documented in class.jetpack-cli.php */
250
		if ( apply_filters( 'jetpack_start_enable_sso', $auto_enable_sso ) ) {
251
			$redirect_uri = add_query_arg(
252
				array(
253
					'action'      => 'jetpack-sso',
254
					'redirect_to' => rawurlencode( admin_url() ),
255
				),
256
				wp_login_url() // TODO: come back to Jetpack dashboard?
257
			);
258
		} else {
259
			$redirect_uri = admin_url();
260
		}
261
262
		// Generate secrets.
263
		$role    = Jetpack::translate_user_to_role( $user );