Problem
- No account — clicking an invitation link with no account shows "Invitation unavailable" instead of a signup prompt
- No auto-join — after signing up, users aren't automatically added to the workspace
- Wrong email — no clear message when logged in with a different account than the one invited
- Email not sent —
CreateInvitation was not sending invitation emails
- SMTP reliability — SMTP goroutine had no timeout or panic recovery
- Stuck button — invite button never reset after success/failure
Solution
Backend: send invitation email in a safe goroutine with defer recover(), add 15s SMTP timeout, expose email in ValidateInvitation response
Frontend: full state machine on the invitation page — not logged in → inline Sign In / Create Account forms; after signup → auto-login → auto-accept; after sign-in → auto-accept; wrong email logged in → explicit mismatch message
Acceptance Criteria
Problem
CreateInvitationwas not sending invitation emailsSolution
Backend: send invitation email in a safe goroutine with
defer recover(), add 15s SMTP timeout, exposeemailinValidateInvitationresponseFrontend: full state machine on the invitation page — not logged in → inline Sign In / Create Account forms; after signup → auto-login → auto-accept; after sign-in → auto-accept; wrong email logged in → explicit mismatch message
Acceptance Criteria