Basically, under normal conditions, praying while covered in face is not recommended. This is in accordance with the following hadith,
عَنْ أَبِي هُرَيْرَةَ قَالَ نَهَى رَسُولُ اللَّهِ صَلَّى اللهُ عَلَيْهِ وَسَلَّمَ أَالَ يُغَطِّيَ الرَّامهصُ نَامَ لرامه الَُّ
From Abū Hurairah (narrated), he said: Rasulullah prohibits a person from covering his mouth in prayer [HR. Ibn Mājah]
In this series of hadith sanad there is a rawi named al-Ḥasan Ibn Zakwān whose history has been disputed by critics of hadith. Most of them consider him a daif rawi because he often makes mistakes, does tadlīs and in this hadith history uses the formula 'anʻanah (' from '). Others consider the hadith to be hasan on the grounds that Yaḥyā Ibn Sa'īd, a trusted hadith expert, narrated his hadith [Mīzān al-I'tidāl, II: 236-237, number 1847].
In this hadith there is a prohibition against covering part of the face, however, if this hadith is seen as makbajarul according to the opinion which states it is hasan, the prohibition does not reach the haram law. This is shown by Ibn Majah himself who put the hadith in the chapter of Mā Yukrahu fī aṣ-Ṣalāh (things that [makruh] dislike in prayer). In addition, the prohibition in this hadith does not apply generally because it has a special reason, namely so as not to resemble the Magi in worship as informed in the book Syarḥ Sunan Abī Dāwūd by Badr ad-Dīn al-'Aini.
Therefore, covering part of the face with a mask when praying in congregation at a mosque or prayer room while not free from the Covid-19 pandemic as it is now is not included in the above prohibitions and does not damage the validity of prayers. Especially in times of epidemic threat like today, masks are one of the personal protective equipment that is highly recommended to be worn when outside the home, including when having to go to the mosque or prayer room to pray in congregation. Thus, masks have become a basic urgent need (al-ḥājah) to be fulfilled. This is in line with fiqh principles,