[fix bug 810992] Support ?next on login.