Spaces:
Sleeping
Sleeping
Commit History
-
Require auth on admin read routes (was serving student PII anonymously)
Donne120 +1: Claude Opus 5Seven admin GETs were readable by anyone on the internet with no credentials. Confirmed against the live Space: GET /api/admin/students -> student names + email addresses GET /api/admin/curators -> staff names + calendar links GET /api/admin/overview -> org id, name, student counts also opportunities, inquiries, bookings, office-hours current_org_read fell back to the default organization when no auth was presented. Its docstring justified this as acceptable because the dashboard's Server Components fetched without a token and these were "non-sensitive analytics reads". Both halves were wrong: the reads expose personal data, and every dashboard screen is now a client component specifically so the admin's Firebase token is attached — nothing legitimate used the anonymous path. current_org_read now delegates to current_org. Kept as a distinct name so the read/write split stays visible at call sites, but no token means no data. An existing test asserted the fallback…a1054d8