Constructing login form with validations in controller