Skip to content

feat(web): Google sign-in and company onboarding - #30

Merged
Lyons800 merged 1 commit into
mainfrom
feat/auth-onboarding
Jul 26, 2026
Merged

feat(web): Google sign-in and company onboarding#30
Lyons800 merged 1 commit into
mainfrom
feat/auth-onboarding

Conversation

@Lyons800

Copy link
Copy Markdown
Owner

Merges the Better Auth identity stack and connects it to the workspace that already existed. The auth schema was already migrated into Neon.

Two changes beyond the merge

The auth instance was built at module scope. next build imports every route module while collecting page data, so compiling required production secrets — CI has none, so this would have gone red on merge and forced real credentials into the build environment for nothing. getAuth() now builds on first use and memoises; the pg pool still lives on globalThis so it survives across invocations. Verified by building with all four auth variables unset.

Organisation scoping now has exactly one decision point. resolveOrganizationId() reads the session and returns the active organisation, falling back to the demo only for visitors. The direction matters: an unauthenticated visitor can reach only the demo, and a signed-in user is never silently handed it. Seed agents go into the demo organisation and nowhere else — pre-populating a real company with approvers it never added would be inventing authority.

sign-in and onboarding move into (marketing) so they render without workspace chrome.

Boundary preserved

Google and Better Auth organization roles are application identity only. They never grant payment authority — that still requires a distinct human resolved through AgentBook plus a role issued by the company.

lint · typecheck (19 tasks) · 369 tests · build (with and without secrets) all green.

Merges the Better Auth identity stack and connects it to the workspace that
already existed. The auth schema was already migrated into Neon; this wires
it to the product.

Two changes were needed beyond the merge.

The auth instance was constructed at module scope, so next build — which
imports every route module while collecting page data — required production
secrets to compile. CI has none, so this would have gone red on merge and
would have forced real credentials into the build environment for nothing.
getAuth() now builds on first use and memoises; the pg pool still lives on
globalThis so it survives across invocations. Verified by building with all
four auth variables unset.

Organisation scoping now has exactly one decision point. resolveOrganizationId
reads the session and returns the active organisation, falling back to the
demo organisation only for visitors. The direction matters: an unauthenticated
visitor can reach only the demo, and a signed-in user is never silently handed
it. The seed agents are inserted into the demo organisation and nowhere else —
pre-populating a real company with approvers it never added would be inventing
authority.

sign-in and onboarding move into the (marketing) group so they render without
the workspace chrome. Their test imports carry the .js extensions node16
resolution requires; pnpm check typechecks a config that turbo run typecheck
does not.

Google and Better Auth organization roles remain application identity only.
They never grant payment authority: that still requires a distinct human
resolved through AgentBook plus a role issued by the company.
@Lyons800
Lyons800 force-pushed the feat/auth-onboarding branch from dd859c6 to ed3c604 Compare July 26, 2026 06:20
@Lyons800
Lyons800 merged commit ed3c604 into main Jul 26, 2026
3 of 4 checks passed
@Lyons800
Lyons800 deleted the feat/auth-onboarding branch July 26, 2026 06: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