[fix bug 810992] Support ?next on login.
Merge pull request #524 from glogiotatidis/810992

[fix bug 810992] Support ?next on login.