Spaces:
Sleeping
Sleeping
Commit History
14 days ago
-
fix(security): close auth takeover, harden RLS, repair adoption and NGO flows
Auth - Never sign in or refresh on a shared Supabase client; use a throwaway client per call so the server cannot hold another user's session - reset-password now requires the recovery token and changes only that user's password; logout revokes only the caller's session - Add POST /api/auth/refresh; frontend refreshes once on 401 Database - Migration 15: block users changing their own role, ban state or NGO approval; hide private profile columns from anon/authenticated; make counter RPCs service-role only - getProfile returns public columns only Adoption and NGO onboarding - Cross-user writes (plant status, adopter garden row) go through the service role and their errors are checked; approval cannot double-adopt - NGO applicants can reach onboarding and their status while still adopters; approved NGOs editing details stay approved Smaller fixes - Like, bookmark and comment counters cannot drift - Credentials bypass the HTML sanitiser - Care tips use a current Gemini mode…55ffa7e
-
feat(ngo): make the plant register a survival view
The register listed name, species and a photo, and nothing about whether the trees were alive. Knowing which trees are surviving is the NGO's job, and the page said nothing about it. Each row now carries its guardian, the age of the last growth report and the reported health, and the page opens on "Needs attention": trees whose guardians have gone quiet past the monthly rhythm they agreed to, and trees reported critical or dead. A banner counts the quiet ones, because silence is what losing a tree looks like in the data. Adds GET /api/ngo/plants for this, which returns the NGO's plants with their guardian and latest report in three queries no matter how many plants there are. The alternative in the client was one report request per plant. Two inventions removed, the same class as #275: the stock Unsplash photograph that stood in when the NGO had uploaded none, and "Common species" printed where the species was simply unknown. They now read "No photo" and "Species not recorded". Rem…04189d6
-
Build: Final production handover with seeded data, admin fixes, and clean documentation
shard-c671a9cd6
-
## fix(map,plants): improve map rendering and adoption UI feedback
RishabhHatlunkar- Fix "AI Identify" navigation link in Navbar (pointed to wrong route) - Add PostGIS EWKB coordinate parsing to the map for proper marker rendering - Implement stable coordinate jitter to prevent markers from stacking perfectly - Enhance Plant Detail page with status-specific feedback (Pending/Adopted/Role-check) - Ensure "Apply to Adopt" button is only visible when applicable7c69d9c