agent_crew
agent_crew copied to clipboard
feat: Accept Invite page
Summary
Create the Accept Invite page that allows users to join an existing organization via an invite link.
Context
Organization owners generate invite links (tokens). When someone opens the link, they see the org name and a registration form pre-associated to that organization.
Page: Accept Invite (/invite/:token)
Flow
- Page loads → calls
GET /api/auth/invite/:token - If token valid → show org name + registration form
- If token expired/invalid → show error with link to login
- User fills form → calls
POST /api/auth/register/invite - On success → store tokens → redirect to dashboard
UI Elements
- Organization name display (e.g., "You've been invited to join Acme Corp")
- Name input
- Email input (pre-filled if invite has email, read-only in that case)
- Password input
- Password confirmation
- "Join Organization" button
- Link to login ("Already have an account?")
Error States
- Token expired: "This invite link has expired. Ask your admin for a new one."
- Token already used: "This invite link has already been used."
- Token not found: "Invalid invite link."
- Email mismatch: "This invite was sent to a different email address."
- Email taken: "An account with this email already exists."
Design
- Same centered card layout as Login/Register pages
- Show org logo/name prominently
- Dark slate theme consistent with rest of app
Acceptance Criteria
- [ ] Invite page at
/invite/:tokenroute - [ ] Token validation on page load
- [ ] Pre-filled email when invite specifies one
- [ ] Registration form with password validation
- [ ] All error states handled with user-friendly messages
- [ ] Redirect to dashboard on success
- [ ] Link to login for existing users
- [ ] Mobile responsive
- [ ] Unit tests
Dependencies
- Depends on: #35 (auth types + API client)
- Backend dependency: agent_crew_api#53 (invite endpoints)
Related Issues
Part of Auth & Multi-tenancy epic (Phase 1).
Completed in v0.3.0 release (commit 8ca8e5c). All auth UI features implemented and tested.