Aromatisation of a ring which includes nitrogen
This would be the mechanism I propose for the reaction:

 

I have taken the $\ce{pH}$ of the medium to be $4.5$. That should explain the protonation of the $\ce{-OH}$ groups.