added validations to login controller and template