chlamydia giving birth

What happens if you don't have the chance to get your chlamydia treated before you give birth? Do they just give you and baby antibiotics in the hospital before you both leave or? TIA. Edit- I'm saying in the event of preterm birth, or before the antibiotics have gotten the chance to run its full course. I won't let this go untreated... Not the point of this post.