Move user name lookup to the login handler.