Fix Ajax error on "enter" login with invalid credentials