extend login_view with validation
(cherry picked from commit 162e800)