agent_crew icon indicating copy to clipboard operation
agent_crew copied to clipboard

feat: Accept Invite page

Open sre-helmcode opened this issue 8 months ago • 1 comments

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

  1. Page loads → calls GET /api/auth/invite/:token
  2. If token valid → show org name + registration form
  3. If token expired/invalid → show error with link to login
  4. User fills form → calls POST /api/auth/register/invite
  5. 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/:token route
  • [ ] 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).

sre-helmcode avatar Mar 07 '26 12:03 sre-helmcode

Completed in v0.3.0 release (commit 8ca8e5c). All auth UI features implemented and tested.

sre-helmcode avatar Mar 11 '26 14:03 sre-helmcode