- Created migration-actions.ts with server actions for claiming lists
- Added ClaimListsModal component for UI during registration
- Integrated claim modal into RegisterForm
- Created anonymous-lists.ts utilities for tracking lists in localStorage
- Added migrate-lists.ts script for deployment migration
- Created comprehensive MIGRATION_GUIDE.md documentation
- Added migration tests with 100% pass rate
- Updated package.json with db:migrate script
- Added tsx as dev dependency for running migration scripts
Requirements: 10.2, 10.3, 10.4, 10.5
- Users can claim existing lists on first registration
- All list data is preserved during migration
- All lists have an owner after migration
- Migrated lists appear in user's account
- Add sharing indicator to ListCard showing collaborator count
- Add permission badge and share button to ListDetailView
- Disable editing in ItemForm for viewers with visual feedback
- Add permission checks to item detail and edit pages
- Hide edit/delete buttons for viewers on item detail page
- Pass permission and collaborator data through component hierarchy
- Update navigation to include profile and invitations links (already done in previous tasks)
Implements task 15 from user-auth-and-sharing spec
- Add updateProfile and updatePassword server actions
- Add getUserProfile function with sensitive data protection
- Create ProfileForm component for name and email updates
- Create PasswordChangeForm component with current password verification
- Create profile page at /profile with all profile management features
- Add profile and invitations navigation links to main page
- Implement email uniqueness validation
- Implement password hashing on password change
Requirements: 7.1, 7.2, 7.3, 7.4, 7.5
- Verified getCollaborators server action (Requirement 5.4)
- Verified updateCollaboratorPermission server action (Requirement 6.5)
- Verified removeCollaborator server action (Requirement 5.5)
- Added permission level enforcement throughout (Requirement 6.1)
- Created comprehensive test suite for collaborator management
- All tests passing (6/6 tests)
- All item operations (createItem, updateItem, deleteItem, toggleItem) now enforce access control
- Editor vs viewer permissions properly enforced (only owner/editor can modify)
- Item queries (searchItems, getItemsByFilter, getItem) filter by list access
- Validates Requirements 6.2, 6.3, and 9.2
- Created lib/permissions.ts with four utility functions:
- canAccessList: Check if user can view a list
- canEditList: Check if user can edit a list or its items
- canDeleteList: Check if user can delete a list (owner only)
- getPermission: Get user's permission level for a list
- Added comprehensive unit tests in lib/__tests__/permissions.test.ts
- All 24 tests passing
- Validates Requirements 4.3, 6.2, 6.3
- Modified createList to assign ownerId to authenticated user
- Updated getLists to filter by user access (owner or collaborator)
- Added ownership checks to updateList (owner or editor can update)
- Added ownership checks to deleteList (only owner can delete)
- Implemented access control for all item operations (create, update, delete, toggle)
- Updated getItem, searchItems, and getItemsByFilter to enforce access control
- Added dynamic rendering to pages that use authentication
- Cascade deletion already handled by database schema (onDelete: Cascade)
Requirements: 4.1, 4.2, 4.3, 4.5
- Created loginUser server action with credential validation
- Implemented password verification using bcrypt (via NextAuth authorize)
- Session creation on successful login handled by NextAuth
- Invalid credentials handled with appropriate error messages
- Added comprehensive unit tests for login functionality
- All tests passing (11/11)
Requirements: 2.1, 2.2
- Created registerUser server action with email/password validation
- Implemented password hashing with bcrypt (10 rounds)
- Added email uniqueness check to prevent duplicate registrations
- Created session after successful registration using NextAuth
- Added comprehensive validation for email format and password length (min 8 chars)
- Added email and password validation utilities to lib/validation.ts
- Removed PrismaAdapter from auth.ts (using JWT sessions only)
- Added vitest testing framework and configuration
- Created comprehensive unit tests for registration functionality
- All tests passing (6/6)
Requirements covered: 1.1, 1.2, 1.3, 1.4, 1.5
- Install next-auth@beta, bcryptjs, zod, and @auth/prisma-adapter
- Create auth.ts with credentials provider and JWT session strategy
- Create auth.config.ts for edge-compatible middleware configuration
- Add NextAuth type extensions for session and JWT
- Create API route handler for authentication
- Configure environment variables for NextAuth
- Add AUTH_SETUP.md documentation
Task: 1. Set up authentication infrastructure
Requirements: 1.1, 2.1