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

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