Disabled token validation and session auth on /api/evidence endpoint. Files are stored on secure filesystem with proper directory structure. Path traversal protection remains in place. NOTE: Server running old compiled code - requires rebuild to take effect. Build failing on server (npm/pnpm not found). Need proper deployment pipeline.
1.5 KiB
1.5 KiB
Remove Invite-by-Email Feature
Date: 2026-07-18
Scope: Admin user management — remove email invite flow, keep direct-add only.
Problem
Two user-creation modes exist: "Invite by email" (sends Supabase invite link) and "Add directly" (admin sets password). The invite flow requires NEXT_PUBLIC_APP_URL to be configured and sends an external email, adding operational complexity. Only direct-add is needed going forward.
Changes
1. components/admin/user-manager.tsx
- Remove
modestate and the invite/create toggle buttons. - Remove all invite-specific conditional text (button label, error message).
- Password field always visible and always required.
payload.passwordalways included in POST body.
2. app/api/admin/users/route.ts (POST handler)
- Remove the
elsebranch (lines 62–77) that callsadmin.auth.admin.inviteUserByEmail. - Remove
directCreatevariable — password is now always required. - Require
passwordupfront; return 422 if missing or < 8 chars. - Audit log action always
'created'. - Error message for missing service role key simplified (no mention of "invites").
3. app/auth/invite-callback/page.tsx
- Delete file and directory — no longer reachable or needed.
4. No DB migration needed
- No schema changes. Audit log continues using existing
write_audit_logRPC.
Out of Scope
app/api/users/route.ts— unrelated active-users list, untouched.- Resend / WhatsApp notification wiring — untouched.