Fix the bug with return value when login failed.