All perfect praise be to Allah, The Lord of the Worlds. I testify that there is none worthy of worship except Allah, and that Muhammad is His slave and Messenger.
It is the right of the husband to have more than one wife if he wishes as Allah has given him that right. Allah Says (what means): {Marry (other) women of your choice, two or three or four.} [Quran 4: 3]
The fact that the contract was done in the mosque and not in a court does not have any influence on the validity of the contract if the Sharee’ah conditions for a valid marriage were met.
As for you, we advise you to accept this reality and continue being good with your husband and keeping good company with him. We also advise your husband to be just when dealing with his wives (i.e. you and the other one).
Allah knows best.