Q: we did zina (adultery). Then we felt guilty. We went to themusjid and did nikah. If we both were junob (impure) does the nikah valid? (text)
A: Going into the musjid in a state of impurity is a sin.
The nikah is valid, provided it was done as per religious requirements.
Allah Certainly Knows Best.