Women in nifaas fasting if the bleeding stops before forty days
Question

There is a woman who gave birth to a baby approximately one week before Ramadan. For the first third of Ramadan she did not fast, but after the first third of Ramadan the bleeding stopped and she began to see a lot of white discharge. Please note that she started to fast after the first third of Ramadan, i.e., after the bleeding stopped and the white discharge appeared, but there was a lot of it. Is her fasting valid, in sha Allah? Is she taahir (in a state of purity)?.
Praise be to Allah.If a woman who is in nifaas (i.e., bleeding following childbirth) sees al-tuhr (end of bleeding) before forty days had passed, she should do ghusl and pray and fast. The tuhr – following menstruation or nifaas – is recognised by one of two signs:
1.White discharge
2.Complete dryness, in the sense that there is no trace of blood, or yellowish or brownish discharge.
Al-Nawawi (may Allah have mercy on him) said: The sign that menses has ended and tuhr (purity) has begun is the cessation of bleeding and of yellowish and brownish discharge. If it stops, then the woman has become pure, regardless of whether any white discharge comes after that or not.
End quote from al-Majmoo‘, 2/562
If in the case asked about the bleeding had stopped, and there was no longer any trace of it or any yellowish or brownish discharge, that this was the sign of tuhr (i.e., she had become pure), and her fast is valid in that case, and it does not matter if there was any white discharge, because that is normal secretion from the vagina.
For more information please see the answers to questions no. 128877 and 156224
And Allah knows best.