Skip to content

Apply default connections and sources when accepting a team invite #2921

Description

@mfroembgen

Problem

DEFAULT_CONNECTIONS and DEFAULT_SOURCES are applied when password registration creates a new team, but not when the first user accepts an invite to an already-created empty team.

That leaves the invited team without its configured default connection and sources. Deployments that bootstrap a team and invite before the first user joins must either mutate MongoDB directly or leave source setup to a user.

Expected behavior

After invite-based user registration succeeds, call setupTeamDefaults(teamInvite.teamId) with the same non-fatal error handling used by password registration.

The existing helper already preserves configured teams by skipping connection or source creation when those objects exist.

Reproduction

  1. Configure DEFAULT_CONNECTIONS and DEFAULT_SOURCES.
  2. Create an empty team and a valid invite for it.
  3. Accept the invite through POST /team/setup/:token.
  4. Observe that the user is created, but the configured connection and sources are not.

Suggested coverage

  • An invited empty team receives its configured defaults.
  • An invited team with existing sources is not overwritten.
  • Default provisioning failure does not prevent the user from joining.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions