Fix missing login logic in templates