Fix bug in Auth::loginById that caused no action to be taken. Closes #1712.
Merge branch '4.0'