Hive
feat(server): add copy invite link to members dashboard
GitHub issue · Closed
What changed
Adds a “Copy invite link” action to each pending invitation’s ⋯ dropdown in the organization Members dashboard (alongside “Revoke invite”). It copies the acceptance URL <server>/auth/invitations/<token> to the clipboard.
Why
Organization member invitations create a valid invitation row and token regardless of whether outbound mail is configured — only the notification email is gated behind Environment.mail_configured?() (accounts.ex:1134). On a self-hosted instance without Mailgun/SMTP, the invite is created but the invitee never gets the acceptance link, so they stay stuck “pending” with no way to join.
The CLI already prints this link (tuist organization invite → “You can also share with them the invite link directly: …”), so admins on air-gapped instances had a path — but the dashboard had no equivalent. The invitations table only exposed “Revoke invite”. This PR closes that gap so the dashboard matches the CLI.
This came out of a self-hosted alpha user report: with TUIST_SKIP_EMAIL_CONFIRMATION=true signup works offline, but dashboard-created invitations were a dead end because no email is sent and the link wasn’t surfaced anywhere.
How it works
- Reuses the existing
Clipboardphx-hook — the same pattern used for the Connect command snippet and the SCIM token copy button — viaphx-hook="Clipboard"+data-clipboard-value. - Builds the URL with
url(~p"/auth/invitations/#{invitation.token}"), the exact route the email and CLI use. Thetokenis already preloaded on each invitation, so there are no query or data-loading changes. - Shown unconditionally (not gated on
mail_configured?), matching the CLI which always prints the link. Consistent with the existing trust model: anyone withinvitation_read(org admins) can already view and revoke these invitations, and the CLI already returns the token to the inviter.
User/developer impact
- Self-hosted instances without SMTP/Mailgun can now onboard org members entirely through the dashboard: invite → copy link → share → invitee signs up (works via
TUIST_SKIP_EMAIL_CONFIRMATION) and opens the link to accept. - No behavior change for hosted/tuist.dev users beyond an extra convenient “copy link” action.
Validation
mix test test/tuist_web/live/members_live_test.exs→ 8 tests, 0 failures, including a new test asserting the invitations tab renders the copy element with the acceptance URL.mix format --check-formattedon the changed files → clean.- Translatable string
"Copy invite link"extracted intodashboard_account.pot(template only; no.pofiles touched, per the gettext workflow).
How to test locally
- Run the server without mail configured (no Mailgun key / SMTP), e.g. a fresh dev instance.
- As an org admin, go to Members → Invitations, invite an email address.
- Open the new invitation’s
⋯menu → Copy invite link. - Paste the link — it should be
<server>/auth/invitations/<token>. Opening it while logged in as the invitee (matching email) lets them accept without any email being sent.
Investigate, reproduce, or fix this item in an isolated repository. Each Flight preserves its outcome and agent session.
Start a Flight and preserve its objective, outcome, and session here.
No GitHub comments yet.