View Source Plausible.Site.Memberships.AcceptInvitation (Plausible v0.0.1)
Service for accepting invitations, including ownership transfers.
Accepting invitation accounts for the fact that it's possible that accepting user has an existing membership for the site and acts permissively to not unnecessarily disrupt the flow while also maintaining integrity of site memberships. This also applies to cases where users update their email address between issuing the invitation and accepting it.
Summary
Functions
@spec accept_invitation(String.t(), Plausible.Auth.User.t(), Keyword.t()) :: {:ok, Plausible.Site.Membership.t()} | {:error, :invitation_not_found | Ecto.Changeset.t()}
@spec transfer_ownership(Plausible.Site.t(), Plausible.Auth.User.t(), Keyword.t()) :: {:ok, Plausible.Site.Membership.t()} | {:error, Ecto.Changeset.t()}