Fix/pii leak distributor dashboard#278
Open
Nareshkumawat-star wants to merge 11 commits into
Open
Conversation
- Convert useAuth.ts (plain hook) to useAuth.tsx with AuthProvider + AuthContext so all components share a single Firebase auth listener and auth state is never re-created on route changes - Update getStoredLanguage() in useLanguage.tsx to fall back to navigator.language when no value is stored in localStorage, so first-time visitors get their browser language automatically - Wrap App.tsx with AuthProvider (outermost) > LanguageProvider, ensuring the language context always reads from a stable auth state Fixes the regression where switching to Hindi (or any non-English language) was reset to English on every route navigation because LanguageProvider's user?.language effect was firing from a freshly-initialised useAuth() call.
Fix/language persistence
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📌 Linked Issue
Closes #236
📝 Summary of Changes
GET /api/users/:idendpoint inserver/routes.tsto optionally verify the requesting user's Firebase token.phonefield for any user except the farmer themselves or an admin.location(address) field to only expose the state/city or fallback to a hidden string for distributors, retailers, and unauthenticated users.🔧 Type of Change
🧪 Testing Steps
Environment tested on:
🎥 Demo
✅ Checklist
npm install+npm run dev)main🌟 GSSoC Declaration