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
| Piece | Status |
|---|---|
Account app (ziteox-auth) | In progress — built in the portal monorepo; production Worker/DNS still gated |
| Target host | auth.ziteox.com (default in code; Cloudflare Worker + DNS awaiting go-live) |
| Legacy stub origin | accounts.ziteox.com still referenced as DEFAULT_ACCOUNTS_ORIGIN when ZITEOX_AUTH_USE_ACCOUNTS is used |
| Admin / client handoff | In 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_rolesper 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_connectionsrecords first/last use per app after handoff; layout spec adds/account/appsfor listing/revoke UI.
App routes (code today)
Under portal: ziteox-auth/src/app:
| Area | Paths |
|---|---|
| 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; appziteox-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
| Fact | Source |
|---|---|
Default origin https://auth.ziteox.com | portal: packages/auth/src/sites.ts (DEFAULT_AUTH_ORIGIN) |
| Cloudflare Workers + OpenNext | portal: ziteox-auth/CLOUDFLARE.md, portal: ziteox-auth/wrangler.jsonc |
| Production DNS / Worker secrets | Gated — 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_idclaim. - 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
| Kind | What |
|---|---|
| Host (target) | auth.ziteox.com |
| Portal app | ziteox-auth |
| Package | @ziteox/auth |
| Handoff | Portal /auth/start → Account login / picker → /auth/handoff → POST Account /api/handoff/token |
| Device flow | /api/device/code, /api/device/token, UI /device |
| Agent tokens | Prefix 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).
Related
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.sqlportal: ziteox-admin/supabase/migrations/20261031200000_app_site_registration.sqlportal: ziteox-admin/supabase/migrations/20261101000000_app_connections.sqlportal: docs/auth-shared-layer-plan-2026-10-29.md- Design:
ziteox-account/ziteox-account-layout-spec.md - Forge:
docs/core/admin-portal-integration.mdx