feat: Add invite code field to registration form
Some checks failed
ParentFlow CI/CD Pipeline / Backend Tests (push) Has been cancelled
ParentFlow CI/CD Pipeline / Frontend Tests (push) Has been cancelled
ParentFlow CI/CD Pipeline / Security Scanning (push) Has been cancelled
ParentFlow CI/CD Pipeline / Build Docker Images (map[context:maternal-app/maternal-app-backend dockerfile:Dockerfile.production name:backend]) (push) Has been cancelled
ParentFlow CI/CD Pipeline / Build Docker Images (map[context:maternal-web dockerfile:Dockerfile.production name:frontend]) (push) Has been cancelled
ParentFlow CI/CD Pipeline / Deploy to Development (push) Has been cancelled
ParentFlow CI/CD Pipeline / Deploy to Production (push) Has been cancelled
CI/CD Pipeline / Lint and Test (push) Has been cancelled
CI/CD Pipeline / E2E Tests (push) Has been cancelled
CI/CD Pipeline / Build Application (push) Has been cancelled

Frontend Changes:
- Added inviteCode field to registration schema (optional)
- Added invite code TextField to registration form UI
- Updated RegisterData interface in AuthContext to include inviteCode
- Pass inviteCode to backend during registration
- Added helpful placeholder text indicating field is optional

User Experience:
- Invite code field appears after email in registration form
- Helper text explains it's optional and can be left blank if registration is open
- Backend will validate the code if REGISTRATION_MODE=invite_only

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Andrei
2025-10-08 11:56:00 +00:00
parent acf1108020
commit 7213075cde
2 changed files with 29 additions and 0 deletions

View File

@@ -31,6 +31,7 @@ export interface RegisterData {
password: string;
name: string;
role?: string;
inviteCode?: string; // Required if REGISTRATION_MODE=invite_only
dateOfBirth: string; // COPPA compliance - required
parentalEmail?: string; // For users 13-17
coppaConsentGiven?: boolean; // For users 13-17
@@ -240,6 +241,11 @@ export const AuthProvider = ({ children }: { children: ReactNode }) => {
deviceInfo,
};
// Add optional invite code if provided
if (data.inviteCode) {
payload.inviteCode = data.inviteCode;
}
// Add optional COPPA fields if provided
if (data.parentalEmail) {
payload.parentalEmail = data.parentalEmail;