airi/apps/ui-server-auth
RainbowBird 7986cc7f69 Merge remote-tracking branch 'origin/main' into server-dev
# Conflicts:
#	.agents/skills/server-gateway-refactor/SKILL.md
#	pnpm-lock.yaml
#	server/apps/api/src/otel/index.ts
#	server/apps/auth/src/auth.ts
#	server/apps/auth/src/steam.test.ts
#	server/apps/auth/src/steam.ts
2026-08-11 13:56:07 +08:00
..
public fix(ui-server-auth): bust poisoned asset caches (#2196) 2026-07-31 22:56:17 +08:00
src Merge remote-tracking branch 'origin/main' into server-dev 2026-08-11 13:56:07 +08:00
index.html fix(auth-ui): remove unavailable analytics script (#2168) 2026-07-30 00:14:49 +08:00
package.json chore: update package dependencies and remove specific catalog references 2026-06-07 19:45:28 +08:00
README.md chore: move the server to an independent folder 2026-08-02 18:43:57 +08:00
tsconfig.json fix(stage-pages,stage-ui): plugin host update 2026-04-22 14:23:45 +08:00
uno.config.ts feat(ui-server-auth): init server auth page 2026-04-03 01:26:38 +08:00
vite-env.d.ts feat(ui-server-auth): init server auth page 2026-04-03 01:26:38 +08:00
vite.config.ts fix(ui-server-auth): bust poisoned asset caches (#2196) 2026-07-31 22:56:17 +08:00
vitest.config.ts wip(ui-server-auth): basic ui, not yet finalized 2026-04-03 15:43:28 +08:00
wrangler.toml feat(auth): migrate auth ui to unique domain 2026-06-09 00:15:34 +08:00

AIRI Server Auth UI

Auth UI for the hosted AIRI server. It is a Vue/Vite app deployed separately from server/apps/api and used for Better Auth sign-in, email verification, password reset, profile, and Electron OIDC callback relay flows.

Use When

  • Building user-facing auth pages backed by server /api/auth/* endpoints.
  • Updating login, sign-up, verification, reset-password, account profile, or Electron auth relay UX.
  • Deploying the auth surface to Cloudflare Workers Static Assets.

Do Not Use When

  • Building the main stage app sign-in callback pages that consume OIDC tokens.
  • Adding admin-only operational pages. Those belong in the standalone proj-airi admin repository.

Commands

pnpm -F @proj-airi/ui-server-auth dev
pnpm -F @proj-airi/ui-server-auth typecheck
pnpm -F @proj-airi/ui-server-auth build

Deployment

pnpm -F @proj-airi/ui-server-auth build writes to apps/ui-server-auth/dist. Vue Router owns /ui/*, while Vite assets are served from root /assets-v2/* so Cloudflare Pages can serve static files without rewriting nested asset paths. The versioned namespace moves existing clients away from previously poisoned /assets/* browser cache entries. Both namespaces use Cache-Control: public, no-cache, allowing browsers to retain files only when Pages revalidates them. public/_redirects scopes the SPA rewrite to /ui/*, and the top-level public/404.html keeps missing assets and other unknown paths as HTTP 404 responses.

The production GitHub Actions workflow deploys this app to the Cloudflare Pages project moeru-ai-airi-auth with separate auth-account credentials:

AUTH_CLOUDFLARE_ACCOUNT_ID=...
AUTH_CLOUDFLARE_API_TOKEN=...

apps/ui-server-auth/wrangler.toml remains available for Workers Static Assets deployments, but production CI uses Cloudflare Pages direct upload.

Production expects:

VITE_SERVER_URL=https://api.airi.build

The server redirects historical /auth/* URLs to AUTH_UI_URL, which defaults to https://accounts.airi.build/ui.

The server-dev workflow deploys a Cloudflare Pages branch build at https://server-dev.airi-server-auth.pages.dev/ui/ with VITE_SERVER_URL=https://airi-server-dev.up.railway.app. Set the server-dev API environment variable AUTH_UI_URL=https://server-dev.airi-server-auth.pages.dev/ui when the full dev auth redirect chain should stay on server-dev.