[Agent] Embed form submittable before anonymous auth completes
Bug· by Elsama· 1 month ago
Agent brief
Category: bug | Severity: high | Effort: S
Problem
Embed authState starts as 'pending' but the submit form renders immediately. User can submit before signInAnonymously() completes → unauthenticated error.
Repro
- Open embed on anonymous project
- Type title quickly and submit before auth resolves
- Error: "Please reload and try again"
Files
src/app/embed/[projectSlug]/client.tsx— add pending loading state
Acceptance criteria
- Show spinner/skeleton while
authState === 'pending' - Submit disabled until
authState === 'ok' - No race on fast submit
Suggested approach
Early return loading UI for pending; disable submit button until ok.