Improve form handling in login view.