Added functionality to registration and login templates