mirror of
https://github.com/saltbo/zpan.git
synced 2026-09-01 15:49:00 +08:00
6e14fd6033
Bug 1: server/services/s3.ts — putObject passed Web ReadableStream to AWS SDK which only accepts Node Readable or Uint8Array. Convert to Uint8Array via Response.arrayBuffer() for cross-runtime compatibility. Bug 2: server/routes/ihost.ts + shared/schemas — presign endpoint returned 400 (zod validation) instead of 413 for oversized files. Moved size check from schema .max() to handler with proper 413 status. Bug 3: src/lib/api.ts — createIhostApiKey sent `permissions` in the request body, but better-auth's apiKey plugin rejects client-set permissions (SERVER_ONLY_PROPERTY). Removed it; server defaultPermissions handles it automatically. Also: session.create.before now checks org existence by slug before creating, preventing UNIQUE constraint failures when membership was revoked but org still exists. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>