Fixed authentication issues in the template