Skip to content

Use passwordless setup and initialize auth without settings reads - #76

Merged
tnkuehne merged 2 commits into
mainfrom
fix/operator-runtime-configuration
Oct 22, 2026
Merged

tnkuehne merged 2 commits into
mainfrom
fix/operator-runtime-configuration

Conversation

@tnkuehne

@tnkuehne tnkuehne commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Local operator passwords duplicated the existing Better Auth email-code login. Runtime construction also loaded and decrypted installation-wide settings before requests could reach their route. This change removes both paths: operator setup uses native OTP, while authentication is initialized from deployment configuration and organization settings are read by the operations that need them.

  • First-owner setup accepts name and email, then uses the existing OTP sign-in form. Password sign-in, password creation, the password-enable flag, and the separate setup-completion endpoint/UI are removed. Company SSO uses the existing verify/test/activate flow and remains mandatory once activated.
  • LOGIN_CODE_DELIVERY=email is the default and requires an email adapter. Explicit console mode prints sign-in codes in the server log; deployment examples select this mode for operator setup. Invitations still require actual email delivery. Mail failures never fall back to logs. Hosted deployment forwards the selected mode to both initialization and the running Worker.
  • File bootstrap uses the existing short-lived operator session and closes it afterwards, without sending email or marking the owner's address verified. The recovery command remains available.
  • Migration 0025_passwordless_sign_in.sql deletes credential/password accounts and drops the old installation flag, preserving users, memberships and SSO accounts. Configure OTP delivery or working SSO before upgrading; pending bootstrap files must omit owner.password.
  • Runtime initialization no longer reads the default organization's SSO/directory settings or rebuilds authentication on settings edits. Native SSO reads updated providers on demand; directory lookup loads its selected organization's configuration. Health requests do not wait for settings tables.

Validation: workspace types/format/lint; 30 browser auth/management tests; 9 hosted provisioning tests; 101 integration tests; 15 local Cloudflare tests; browser setup, OTP, DNS verification, company SSO, recovery and invitation/organization flows; Node and Cloudflare builds. Tests use local services and synthetic identities.

Operator documentation is maintained separately in #58 and must remain unpublished until a release includes this behavior. No deployment is included in this PR.

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge; the hosted sign-in configuration mismatch is fixed.

Summary

This PR replaces operator passwords with one-time sign-in codes and builds authentication without first loading organization settings.

  • First-owner setup creates an account that signs in with a one-time code.
  • Requests load organization settings only when a feature needs them.

No new actionable issues were found in the changes since the previous review. This review checked code and test changes; it did not run the tests.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A["Deployment configuration"] --> B["LOGIN_CODE_DELIVERY"]
  B --> C["Hosted initialization"]
  B --> D["Worker variables"]
  D --> E["One-time sign-in codes"]
  E --> F["Email"]
  E --> G["Server log when explicitly selected"]
Loading

Reviews (2) · Last reviewed commit: "Preserve hosted sign-in delivery and exe..." · Reviewed by Greptile

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
widefleet-docs 06d527a Oct 22 2026, 06:03 PM

@tnkuehne
tnkuehne merged commit 3f3479a into main Oct 22, 2026
18 checks passed
@tnkuehne
tnkuehne deleted the fix/operator-runtime-configuration branch October 22, 2026 18:20
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