Verifies if the given redirect_to value enables SSR or not.

@param {string}   redirectToQueryValue The URI-encoded value of the analyzed redirect_to
@return {boolean} If the value of &redirect_to= on the log-in page is compatible with SSR
function isRedirectToValidForSsr( redirectToQueryValue ) {
	if ( 'undefined' === typeof redirectToQueryValue ) {
		return true;
	}

	const redirectToDecoded = decodeURIComponent( redirectToQueryValue );
	return (
		redirectToDecoded.startsWith( 'https://wordpress.com/theme' ) ||
		redirectToDecoded.startsWith( 'https://wordpress.com/go' )
	);
}