moved login out of template