catch exception and properly redirect on failed login.
Merge pull request #1932 from craigh/loginFix

catch exception and properly redirect on failed login.