Skip to content

fix(platform): treat a provisioned account as a verified account - #3408

Merged
yannickmonney merged 2 commits into
mainfrom
fix/provisioned-accounts-verified
Sep 17, 2026
Merged

yannickmonney merged 2 commits into
mainfrom
fix/provisioned-accounts-verified

Conversation

@yannickmonney

Copy link
Copy Markdown
Contributor

Why

Tale sends no mail and has no self-service sign-up, so an address could never become verified by anything a person or an admin can do. The setup wizard's owner and every colleague added under Settings > Members started unverified and stayed that way; only enterprise SSO, SCIM, trusted headers or the CLI's operator-attested declaration ever set the flag.

Everything that requires a vouched-for address therefore refused those people:

  • identity issuance answers 403 IDENTITY_NOT_ELIGIBLE — after Tale's own login page has already sent them back to the application, so the relying party shows a generic failure;
  • conversation synchronization and the notification mirror skip them.

Found from the consuming side: staff on a VAT plus deployment could not use "Continue with Tale" at all. The break-glass administrator added in #3406 already had to set emailVerified itself to work around the same gap.

What changes

A provisioned account is a verified account. Whoever provisions an account names its address, and on this platform that assertion is the only verification there can be — the same one the CLI records as operator-attested. Every account Better Auth creates here now arrives verified (setup wizard owner, members door, the deploy's own accounts). A directory-provisioned account is written straight to the table and keeps its provider's verdict.

Existing deployments heal themselves. After Better Auth's own migrations, boot catches up accounts this instance provisioned — a credential row is the proof that it issued the password. Not a numbered migration: the app's .sql files run before those tables exist and do not own them. It runs on every boot, so a rolling deploy cannot leave an account behind.

Five minutes to sign in. The provider signs the login and consent continuation with the same lifetime it gives an authorization code, so codeExpiresIn: 60 was also the window a person had to find a password and answer a second factor before the request expired and the provider's error page took over. It is now 300 — still a single-use, PKCE-bound code, within the conventional ceiling.

Deployment note

The CLI pins the backend's provider policy before it provisions a managed client, so its codeExpiresIn expectation moves with the platform in this PR. A deploy therefore needs a CLI at least as new as the platform it deploys, which the managed bundle already requires.

Proof

  • bun run --filter @tale/platform test — 76,011 pass; the new unit tests fail without each fix.
  • Real Postgres: the members door's account is verified, and the boot catch-up flips an account provisioned before the rule while leaving a directory account alone (both added to backend/integration-check.ts).
  • bun run --filter @tale/cli test matches the baseline exactly.
  • Docs updated in EN/DE/FR; manual box AUTH-F19 with its automation-register row.

Tale sends no mail and creates no account on its own, so an address could
never become verified by any action a person or an admin can take: the
setup wizard's owner and every colleague added under Settings > Members
started unverified and stayed that way. Only enterprise SSO, SCIM,
trusted headers or the CLI's operator attestation ever set the flag.
Everything that requires a vouched-for address therefore refused them —
the OIDC email_verified claim a relying party reads (identity issuance
answers 403 IDENTITY_NOT_ELIGIBLE, after the login page has already sent
the person back to the application), conversation synchronization and
the notification mirror. The break-glass administrator the deploy
creates had to set the flag itself to work around it.

Whoever provisions an account names its address, and on this platform
that assertion is the only verification there can be - the same one the
CLI records as operator-attested. Every account Better Auth creates here
now arrives verified; a directory-provisioned account is written
straight to the table and keeps its provider's verdict. Accounts
provisioned before the rule are caught up at boot, after Better Auth's
own migrations, by the one statement that can tell them apart: a
credential row means this instance issued the password. It is not a
numbered migration because the app's SQL runs before those tables exist
and does not own them, and it runs on every boot so a rolling deploy
heals itself.

Proven against real Postgres: the members door's account is verified,
the boot catch-up flips an account provisioned earlier and leaves a
directory account alone.
The provider signs the login and consent continuation with the same
lifetime it gives an authorization code, so codeExpiresIn was also the
window a person had to sign in at Tale after an application sent them
here. At sixty seconds, anyone who had to look up a password or reach
for a second factor came back to a refused request and the provider's
error page; starting over from the application was the only way on, and
whether it worked depended on how fast they typed.

Five minutes is the conventional ceiling for a single-use, PKCE-bound
code and leaves room for a password manager and an authenticator. The
CLI pins the backend's provider policy before it provisions a managed
client, so its expectation moves with it — a deployment needs a CLI at
least as new as the platform it deploys, which the managed bundle
already requires.
@yannickmonney
yannickmonney merged commit 44a898d into main Sep 17, 2026
56 checks passed
@yannickmonney
yannickmonney deleted the fix/provisioned-accounts-verified branch September 17, 2026 22:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant