Updated login template to iterate over login messages gracefully