handle submitting the login form via AJAX