A salafi imam told me if I am I holding the urge to urinate and I pray then my salah is not valid. Today I woke up and the time for fajr was almost done and I needed to use the restroom so i prayed then used the restroom then prayed again since I didn’t know the ruling. Was this correct?

Ustadh AbdulAziz al-Haqqan
It is not settled that the prayer is invalid. The majority held it valid but disliked. So, do not repeat your salah.