Systems

Ziteox Account

Shared identity at auth.ziteox.com — sign-in, memberships, roles, and invites for staff and clients.

Ziteox Account

Purpose

Ziteox Account is the shared identity surface for Ziteox apps. Staff and clients sign in once on Account, manage security and profile there, then hand off to the admin or client portal with a host-only session on that portal. Account owns sign-in, memberships, roles, and invites; each portal keeps its own data and permissions.

Current state

PieceStatus
Account app (ziteox-auth)In progress — built in the portal monorepo; production Worker/DNS still gated
Target hostauth.ziteox.com (default in code; Cloudflare Worker + DNS awaiting go-live)
Legacy stub originaccounts.ziteox.com still referenced as DEFAULT_ACCOUNTS_ORIGIN when ZITEOX_AUTH_USE_ACCOUNTS is used
Admin / client handoffIn progress — wired in code; not live until Account gates clear
Layout spec (design)Spec exists; Account shell routes already present in the app

What Account is

  • Identity — Supabase Auth users; Account hosts login, MFA, password reset, invite accept, and signed-in account pages.
  • Memberships & roles — core.app_memberships + core.app_roles per app (admin, client, rail). Admin memberships are org-less; client/rail require an organization.
  • Invites — core.app_invites (pending / accepted / revoked / blocked); invite accept UI under Account.
  • Team-member side vs client side — same Account chrome; after sign-in, handoff targets differ. Admin requires staff + AAL2 (and 12h second-factor freshness). Client does not require staff or second factor for handoff (per site registration).
  • Connected apps — core.app_connections records first/last use per app after handoff; layout spec adds /account/apps for listing/revoke UI.

App routes (code today)

Under portal: ziteox-auth/src/app:

AreaPaths
Sign-in/login, /login/mfa, /login/accounts (account picker)
Account shell/account, /account/personal-info, /account/security, /account/sessions, /account/apps, /account/organizations
Invites/invite, /invite/accept
Auth helpers/auth/confirm, /auth/reset-password, /logout, /handoff
APIs/api/handoff/token, /api/device/code, /api/device/token
Device UI/device

Shared package: portal: packages/auth (@ziteox/auth) — sites, handoff, roles, ceiling, AAL helpers, invite verify, agent identity (zxmcp_).

Layout spec summary (design)

Source: Design folder ziteox-account/ziteox-account-layout-spec.md (read-only; design only).

  • Product: shared sign-in + account site at auth.ziteox.com; app ziteox-auth; audience staff and clients (neutral branding).
  • Principles: one account surface for all portals; Google Account–style shell when signed in; one shared auth card for unsigned / step-up screens; no decorative effects; green as accent only; keep at least one MFA method.
  • Signed-in nav: Home, Personal info, Security, Devices & sessions, Connected apps (desktop left rail; mobile sticky header + horizontal tabs).
  • Auth screens: login, MFA gate, reset password, account picker when portals redirect and remembered accounts exist.
  • Connected apps (spec): Ziteox Admin (admin.ziteox.com), Ziteox Client (client.ziteox.com), bots/integrations if data exists — revoke with confirm.

Some shell pieces already exist in code (e.g. AccountShell in portal: ziteox-auth/src/app/account/layout.tsx); treat unimplemented spec details as design intent, not live UI.

Hosting / domain

FactSource
Default origin https://auth.ziteox.comportal: packages/auth/src/sites.ts (DEFAULT_AUTH_ORIGIN)
Cloudflare Workers + OpenNextportal: ziteox-auth/CLOUDFLARE.md, portal: ziteox-auth/wrangler.jsonc
Production DNS / Worker secretsGated — checklist in CLOUDFLARE.md; deploy not scripted without Laki approval
Live production DNS(unverified) from this checkout alone

Forge Core integration (decided 2026-11-01)

Locked decisions for when Account / admin integrate with Forge Core. The portal side is not built yet.

  • Core project tokens (zxcore_) are per project — never one member token spanning projects.
  • The admin portal registers projects and obtains project tokens on a member’s behalf via Ed25519 admin assertions with a member_id claim.
  • The admin portal shows one admin screen listing a member’s tokens across all their projects, calling Core GET /v1/admin/members/:memberId/tokens (local-only today).
  • Detail: Admin portal integration.

Interfaces

KindWhat
Host (target)auth.ziteox.com
Portal appziteox-auth
Package@ziteox/auth
HandoffPortal /auth/start → Account login / picker → /auth/handoff → POST Account /api/handoff/token
Device flow/api/device/code, /api/device/token, UI /device
Agent tokensPrefix zxmcp_ (portal: packages/auth/src/identity/constants.ts)

Open questions

  • When do live gates clear (migrations, Auth redirect allow-list, Next upgrade, Cloudflare, deploys)? See Auth.
  • How much of the layout spec is already shipped vs still design-only on Connected apps / account picker polish?
  • Timing of Sign-in-with-Ziteox-Account for client Payload CMS admins (planned after Account go-live + security audit).

Sources

  • portal: ziteox-auth/ (app, CLOUDFLARE.md, wrangler.jsonc)
  • portal: packages/auth/ (sites.ts, roles/, handoff/, identity/)
  • portal: ziteox-admin/supabase/migrations/20261029220000_app_role_registry.sql
  • portal: ziteox-admin/supabase/migrations/20261031200000_app_site_registration.sql
  • portal: ziteox-admin/supabase/migrations/20261101000000_app_connections.sql
  • portal: docs/auth-shared-layer-plan-2026-10-29.md
  • Design: ziteox-account/ziteox-account-layout-spec.md
  • Forge: docs/core/admin-portal-integration.mdx