agent_crew
agent_crew copied to clipboard
feat: Login and Register pages
Summary
Create the Login and Register pages for the local auth provider. These pages are conditionally shown based on the auth config from the backend.
Context
When AUTH_PROVIDER=local, users need to authenticate before accessing the app. When AUTH_PROVIDER=noop, these pages are never shown.
Pages
Login Page (/login)
- Email input field
- Password input field
- "Sign in" button
- Link to Register page (only if
registration_enabled=true) - Error display for invalid credentials
- Redirect to
/on success
Register Page (/register)
- Organization name input
- User name input
- Email input
- Password input (with strength indicator)
- Password confirmation input
- "Create Organization" button
- Link back to Login page
- Redirect to
/on success - NOT accessible if
registration_enabled=false(redirect to/login)
Design Guidelines
- Follow existing dark slate theme (bg-slate-950, text-slate-100)
- Centered card layout (max-w-md)
- AgentCrew logo at top
- Consistent with existing form styling in TeamBuilderPage
- Mobile responsive
- Loading state on submit buttons
Flow
App loads → GET /api/auth/config
├─ provider=noop → skip auth, go to dashboard
└─ provider=local
├─ has valid token → go to dashboard
└─ no token → redirect to /login
Acceptance Criteria
- [ ] Login page with email/password form
- [ ] Register page with org name + user details
- [ ] Form validation (required fields, email format, password match)
- [ ] Loading state during API calls
- [ ] Error display for API errors (invalid credentials, email taken, etc.)
- [ ] Redirect to dashboard on successful auth
- [ ] Register page hidden when registration_enabled=false
- [ ] Matches existing dark theme
- [ ] Mobile responsive
- [ ] Unit tests for both pages
Dependencies
- Depends on: #35 (auth types + API client)
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.