Repository navigation
Conversation
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
widefleet-docs | 44be469 | Nov 23 2026, 09:22 AM |
tnkuehne
force-pushed
the
domain-join-docs
branch
2 times, most recently
from
November 23, 2026 08:42
1f065ce to
7490fda
Compare
tnkuehne
force-pushed
the
domain-join
branch
from
November 23, 2026 08:46
0acc499 to
be28549
Compare
tnkuehne
force-pushed
the
domain-join-docs
branch
3 times, most recently
from
November 23, 2026 09:14
a69f96e to
14d67e9
Compare
tnkuehne
added a commit
that referenced
this pull request
Nov 23, 2026
People at a company can now join its organization without an invitation.
An organization opens itself to a company email domain, and everyone
with a verified address on that domain sees it on the organization
chooser and joins as a member.
## Changes
- **Proof that a company owns the domain.** Only someone whose own
sign-in proves the domain can open an organization to it: a linked
Google Workspace account whose saved ID token names the domain as `hd`,
or a Microsoft work account with `xms_edov` outside the consumer tenant.
Better Auth saves these tokens at every sign-in, so no extra claim
storage is needed. An email code proves only a mailbox, so mail-provider
domains never qualify.
- **Creation.** The create form offers "Enable access for example.com",
on by default, when the creator's sign-in proves the domain.
`createOrganization` extensions still receive only `name` and `slug`.
- **Members settings.** Owners and admins see "Join by email domain":
the open domains, removal, and a button for the domain their own sign-in
proves. Removing a domain keeps everyone who already joined. Changes
apply optimistically and roll back on failure.
- **Joining.** The chooser lists organizations open to the person's
verified domain with one colleague from the same domain (never external
guests) and the number of other members, and a verified mark when the
organization verified that domain by DNS for company SSO. Joining checks
the domain again and adds the member under the settings lock that
removing a join domain takes, so a removal either ends the join or
follows it; the 100-member limit is checked under the same lock. A
company sign-in limited to its organization by `companySignInLimit`
joins nothing else, and organizations the installation disables stay
hidden.
- **Reserving new organizations.** An organization that verified a
domain by DNS can turn on "Reserve new organizations for
administrators". People on that domain who are not its owners or admins
can then neither create organizations nor open another organization to
the domain. Existing organizations and their join domains continue
unchanged.
- **Storage.** `organization_settings` gains `join_domains` (`jsonb`,
default `[]`) and `restrict_organization_creation` (`boolean`, default
`false`), next to `sso_required` (migration `0038`).
- **API and CLI.** `GET /organizations/joinable`, `POST
/organizations/{organizationId}/join`, `GET /settings/domain-access`,
`POST /settings/join-domains`, `DELETE /settings/join-domains/{domain}`,
`PUT /settings/organization-creation` and `allowDomainJoin` on `POST
/organizations`. The CLI adds `organizations joinable`, `organizations
join ID`, `organizations create --allow-domain-join` and `settings
domain-access`, `add-join-domain`, `remove-join-domain` and
`restrict-organization-creation`.
- **Organization chooser.** The chooser uses the sign-in page's card: 44
px fields, dark primary buttons and a footer strip for signing out.
Creating asks for a name and a URL; the URL shows the installation's
host and follows the name until it is edited. Subtitles that repeated
the heading are gone.
- Only installations with self-service organization creation expose
joining; elsewhere the endpoints return `403` and the settings section
stays hidden.
## Screenshots
Synthetic fixtures, rendered from `main` and this branch.
### A new colleague joins
| View | Before | After |
| --- | --- | --- |
| 1280 px, light | <img
src="https://gist.githubusercontent.com/tnkuehne/83460012bea405cd20e87a085dc939c3/raw/d65d6365da6f2b9fcac116b43be293da2f03e0c7/before-chooser-newcomer-1280-light.png"
width="420"> | <img
src="https://gist.githubusercontent.com/tnkuehne/83460012bea405cd20e87a085dc939c3/raw/d65d6365da6f2b9fcac116b43be293da2f03e0c7/after-chooser-newcomer-1280-light.png"
width="420"> |
| 1280 px, dark | <img
src="https://gist.githubusercontent.com/tnkuehne/83460012bea405cd20e87a085dc939c3/raw/d65d6365da6f2b9fcac116b43be293da2f03e0c7/before-chooser-newcomer-1280-dark.png"
width="420"> | <img
src="https://gist.githubusercontent.com/tnkuehne/83460012bea405cd20e87a085dc939c3/raw/d65d6365da6f2b9fcac116b43be293da2f03e0c7/after-chooser-newcomer-1280-dark.png"
width="420"> |
| 390 px, light | <img
src="https://gist.githubusercontent.com/tnkuehne/83460012bea405cd20e87a085dc939c3/raw/d65d6365da6f2b9fcac116b43be293da2f03e0c7/before-chooser-newcomer-390-light.png"
width="240"> | <img
src="https://gist.githubusercontent.com/tnkuehne/83460012bea405cd20e87a085dc939c3/raw/d65d6365da6f2b9fcac116b43be293da2f03e0c7/after-chooser-newcomer-390-light.png"
width="240"> |
| 390 px, dark | <img
src="https://gist.githubusercontent.com/tnkuehne/83460012bea405cd20e87a085dc939c3/raw/d65d6365da6f2b9fcac116b43be293da2f03e0c7/before-chooser-newcomer-390-dark.png"
width="240"> | <img
src="https://gist.githubusercontent.com/tnkuehne/83460012bea405cd20e87a085dc939c3/raw/d65d6365da6f2b9fcac116b43be293da2f03e0c7/after-chooser-newcomer-390-dark.png"
width="240"> |
### The domain is verified by DNS for company SSO
| View | After |
| --- | --- |
| 1280 px, light | <img
src="https://gist.githubusercontent.com/tnkuehne/83460012bea405cd20e87a085dc939c3/raw/d65d6365da6f2b9fcac116b43be293da2f03e0c7/after-chooser-verified-1280-light.png"
width="420"> |
| 1280 px, dark | <img
src="https://gist.githubusercontent.com/tnkuehne/83460012bea405cd20e87a085dc939c3/raw/d65d6365da6f2b9fcac116b43be293da2f03e0c7/after-chooser-verified-1280-dark.png"
width="420"> |
| 390 px, light | <img
src="https://gist.githubusercontent.com/tnkuehne/83460012bea405cd20e87a085dc939c3/raw/d65d6365da6f2b9fcac116b43be293da2f03e0c7/after-chooser-verified-390-light.png"
width="240"> |
| 390 px, dark | <img
src="https://gist.githubusercontent.com/tnkuehne/83460012bea405cd20e87a085dc939c3/raw/d65d6365da6f2b9fcac116b43be293da2f03e0c7/after-chooser-verified-390-dark.png"
width="240"> |
### Creating an organization with a Google Workspace sign-in
| View | Before | After |
| --- | --- | --- |
| 1280 px, light | <img
src="https://gist.githubusercontent.com/tnkuehne/83460012bea405cd20e87a085dc939c3/raw/d65d6365da6f2b9fcac116b43be293da2f03e0c7/before-chooser-creator-1280-light.png"
width="420"> | <img
src="https://gist.githubusercontent.com/tnkuehne/83460012bea405cd20e87a085dc939c3/raw/d65d6365da6f2b9fcac116b43be293da2f03e0c7/after-chooser-creator-1280-light.png"
width="420"> |
| 1280 px, dark | <img
src="https://gist.githubusercontent.com/tnkuehne/83460012bea405cd20e87a085dc939c3/raw/d65d6365da6f2b9fcac116b43be293da2f03e0c7/before-chooser-creator-1280-dark.png"
width="420"> | <img
src="https://gist.githubusercontent.com/tnkuehne/83460012bea405cd20e87a085dc939c3/raw/d65d6365da6f2b9fcac116b43be293da2f03e0c7/after-chooser-creator-1280-dark.png"
width="420"> |
| 390 px, light | <img
src="https://gist.githubusercontent.com/tnkuehne/83460012bea405cd20e87a085dc939c3/raw/d65d6365da6f2b9fcac116b43be293da2f03e0c7/before-chooser-creator-390-light.png"
width="240"> | <img
src="https://gist.githubusercontent.com/tnkuehne/83460012bea405cd20e87a085dc939c3/raw/d65d6365da6f2b9fcac116b43be293da2f03e0c7/after-chooser-creator-390-light.png"
width="240"> |
| 390 px, dark | <img
src="https://gist.githubusercontent.com/tnkuehne/83460012bea405cd20e87a085dc939c3/raw/d65d6365da6f2b9fcac116b43be293da2f03e0c7/before-chooser-creator-390-dark.png"
width="240"> | <img
src="https://gist.githubusercontent.com/tnkuehne/83460012bea405cd20e87a085dc939c3/raw/d65d6365da6f2b9fcac116b43be293da2f03e0c7/after-chooser-creator-390-dark.png"
width="240"> |
### Creating an organization from the join view
| View | After |
| --- | --- |
| 1280 px, light | <img
src="https://gist.githubusercontent.com/tnkuehne/83460012bea405cd20e87a085dc939c3/raw/d65d6365da6f2b9fcac116b43be293da2f03e0c7/after-create-from-join-1280-light.png"
width="420"> |
| 1280 px, dark | <img
src="https://gist.githubusercontent.com/tnkuehne/83460012bea405cd20e87a085dc939c3/raw/d65d6365da6f2b9fcac116b43be293da2f03e0c7/after-create-from-join-1280-dark.png"
width="420"> |
| 390 px, light | <img
src="https://gist.githubusercontent.com/tnkuehne/83460012bea405cd20e87a085dc939c3/raw/d65d6365da6f2b9fcac116b43be293da2f03e0c7/after-create-from-join-390-light.png"
width="240"> |
| 390 px, dark | <img
src="https://gist.githubusercontent.com/tnkuehne/83460012bea405cd20e87a085dc939c3/raw/d65d6365da6f2b9fcac116b43be293da2f03e0c7/after-create-from-join-390-dark.png"
width="240"> |
### Choosing among existing organizations
| View | After |
| --- | --- |
| 1280 px, light | <img
src="https://gist.githubusercontent.com/tnkuehne/83460012bea405cd20e87a085dc939c3/raw/d65d6365da6f2b9fcac116b43be293da2f03e0c7/after-chooser-member-1280-light.png"
width="420"> |
| 1280 px, dark | <img
src="https://gist.githubusercontent.com/tnkuehne/83460012bea405cd20e87a085dc939c3/raw/d65d6365da6f2b9fcac116b43be293da2f03e0c7/after-chooser-member-1280-dark.png"
width="420"> |
| 390 px, light | <img
src="https://gist.githubusercontent.com/tnkuehne/83460012bea405cd20e87a085dc939c3/raw/d65d6365da6f2b9fcac116b43be293da2f03e0c7/after-chooser-member-390-light.png"
width="240"> |
| 390 px, dark | <img
src="https://gist.githubusercontent.com/tnkuehne/83460012bea405cd20e87a085dc939c3/raw/d65d6365da6f2b9fcac116b43be293da2f03e0c7/after-chooser-member-390-dark.png"
width="240"> |
### Members settings
| View | Before | After |
| --- | --- | --- |
| 1280 px, light | <img
src="https://gist.githubusercontent.com/tnkuehne/83460012bea405cd20e87a085dc939c3/raw/d65d6365da6f2b9fcac116b43be293da2f03e0c7/before-members-1280-light.png"
width="420"> | <img
src="https://gist.githubusercontent.com/tnkuehne/83460012bea405cd20e87a085dc939c3/raw/d65d6365da6f2b9fcac116b43be293da2f03e0c7/after-members-1280-light.png"
width="420"> |
| 1280 px, dark | <img
src="https://gist.githubusercontent.com/tnkuehne/83460012bea405cd20e87a085dc939c3/raw/d65d6365da6f2b9fcac116b43be293da2f03e0c7/before-members-1280-dark.png"
width="420"> | <img
src="https://gist.githubusercontent.com/tnkuehne/83460012bea405cd20e87a085dc939c3/raw/d65d6365da6f2b9fcac116b43be293da2f03e0c7/after-members-1280-dark.png"
width="420"> |
| 390 px, light | <img
src="https://gist.githubusercontent.com/tnkuehne/83460012bea405cd20e87a085dc939c3/raw/d65d6365da6f2b9fcac116b43be293da2f03e0c7/before-members-390-light.png"
width="240"> | <img
src="https://gist.githubusercontent.com/tnkuehne/83460012bea405cd20e87a085dc939c3/raw/d65d6365da6f2b9fcac116b43be293da2f03e0c7/after-members-390-light.png"
width="240"> |
| 390 px, dark | <img
src="https://gist.githubusercontent.com/tnkuehne/83460012bea405cd20e87a085dc939c3/raw/d65d6365da6f2b9fcac116b43be293da2f03e0c7/before-members-390-dark.png"
width="240"> | <img
src="https://gist.githubusercontent.com/tnkuehne/83460012bea405cd20e87a085dc939c3/raw/d65d6365da6f2b9fcac116b43be293da2f03e0c7/after-members-390-dark.png"
width="240"> |
Checked: joining, creating with and without the domain switch, the
verified mark, the way back from the create form, choosing an existing
organization and the Members section, each at 390 and 1280 px in light
and dark.
Not checked visually: the chooser for people who already have
organizations and also see joinable ones under "Open to example.com",
the error feedback in the Members section, and the message shown to
blocked creators.
## Validation
- `provider-email-domain.test.ts`: Google `hd` match, mismatch, missing
and unverified email, a Gmail-style account, Microsoft work tenant with
`true` and `"1"`, consumer tenant with `"1"`, `xms_edov` false, missing
and other values, missing tenant, malformed tokens and other providers.
- `domain-access.integration.test.ts`: creation with and without proof
(email code only, consumer tenant, personal Google account, unverified
address), joining (allowed, other domain, unverified email, external
guest in a company sign-in, disabled organization, member limit),
colleague names and the Verified label, administrator settings through
the API (unproven and foreign domains, member access, reservation
without verified domain, removal keeping members) and the creation
reservation (blocked creators, blocked domain opening, administrators of
the reserving organization, existing join domains kept).
- `domain-access-migration.integration.test.ts`: existing settings rows
receive the closed defaults.
- `cli.test.ts`: the new CLI commands and request bodies against the
synthetic API.
- New browser test `domain-join.spec.ts`: a colleague joins by email
code, an administrator removes and restores the join domain, and a
creator opens a new organization to the domain.
- Full Vitest suite: 1266 passed. Browser suites `auth`, `onboarding`,
`public-onboarding`, `oidc`, `organization-writes`, `self-hosted-sso`,
`setup` and `domain-join`: all passed. `cargo clippy` and `cargo test -p
platform-cli` pass. Control-plane typecheck, format and type-aware lint
are clean.
- Not verified with a real tenant: whether Microsoft sends `xms_edov`
for a Gmail guest in a work tenant. The browser and integration tests
use synthetic ID tokens.
Documentation: #301 (draft, waits for a release that includes this
change).
<!-- greptile_comment -->
<!-- greptile_summary -->
<h2><a
href="https://app.greptile.com/api/retrigger?id=115796857&sig=e4317a3406bdcac13753cdc7dd78637333e0c8abbbbded0263c44fad4da17a03"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://greptile-static-assets.s3.amazonaws.com/badges/RetriggerDark.svg?v=2"><source
media="(prefers-color-scheme: light)"
srcset="https://greptile-static-assets.s3.amazonaws.com/badges/Retrigger.svg?v=2"><img
alt="Retrigger"
src="https://greptile-static-assets.s3.amazonaws.com/badges/Retrigger.svg?v=2"
align="right"></picture></a><a
href="https://app.greptile.com/-/switch-tenant?tenant=mendra&next=%2Fwidefleet%2Fwidefleet%2Fpull%2F300&utm_source=greptile_review&utm_medium=github&utm_campaign=view_in_greptile"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://greptile-static-assets.s3.amazonaws.com/badges/ViewInGreptileDark.svg?v=2"><source
media="(prefers-color-scheme: light)"
srcset="https://greptile-static-assets.s3.amazonaws.com/badges/ViewInGreptile.svg?v=2"><img
alt="View in Greptile"
src="https://greptile-static-assets.s3.amazonaws.com/badges/ViewInGreptile.svg?v=2"
align="right"></picture></a>Confidence Score: 5/5</h2>
<!-- greptile-impact-verdict --> The PR appears safe to merge; no new
blocking issues were found.
<details open><summary><h3>Summary</h3></summary>
Adds joining organizations by verified email domain, administrator
controls, creation restrictions, and API and CLI commands.
- People with a verified company email can join organizations that open
access to their domain.
- Organization admins can manage which company domains may join and
reserve new organizations.
- Organization creators can open their new organization to colleagues on
their company domain.
</details>
<!-- greptile_confidence_score:5 -->
<sub>Reviews (7) · Last reviewed commit: ["Return to the organization
choices
after..."](8a67c2b)
· [Reviewed by
Greptile](https://www.greptile.com/?utm_source=greptile_review&utm_medium=github&utm_campaign=review_public&utm_content=widefleet/widefleet)</sub>
<!-- /greptile_comment -->
tnkuehne
force-pushed
the
domain-join-docs
branch
from
November 23, 2026 09:21
14d67e9 to
44be469
Compare
Members can join organizations that are open to their company email domain from the organization chooser or the CLI. Administrators open an organization to the domain their Google Workspace or Microsoft work sign-in proves, and organizations with a verified company domain can reserve new organizations on it for their administrators. The API and CLI references describe the new endpoints, the allowDomainJoin creation field and the new commands.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Documents joining organizations by company email domain, implemented in #300.
allowDomainJoinon organization creation and the joining and settings endpoints.--allow-domain-join,organizations joinableandorganizations join.Blocked until a published release includes #300. The pages name platform 0.7.21; update the version if that release differs.