Just tell your father in law directly not to curse in front of the baby as your baby will imitate him like a parrot and you don’t want those words to be part of baby’s vocabulary
Talk to your husband and both of you talk to them about it. Be direct with them.
I will say directly
Good luck!