Remove mongodb ref, authenticate user and add to scope.