Implemented finishlogin().