feat(useAuth): add refreshOnMount option to sync user data#13
feat(useAuth): add refreshOnMount option to sync user data#13emilianocalzada wants to merge 1 commit into
Conversation
Fixes issue where useAuth returns stale user data after screen navigation. When refreshOnMount is true, the hook calls authRefresh() on mount to fetch the latest user data from the server.
WalkthroughA new Changes
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (3)
🧰 Additional context used🧠 Learnings (12)📓 Common learnings📚 Learning: 2025-10-18T12:22:11.415ZApplied to files:
📚 Learning: 2025-10-18T12:22:42.070ZApplied to files:
📚 Learning: 2025-10-18T12:22:11.415ZApplied to files:
📚 Learning: 2025-10-18T12:22:11.415ZApplied to files:
📚 Learning: 2025-10-18T12:22:11.415ZApplied to files:
📚 Learning: 2025-10-18T12:22:11.415ZApplied to files:
📚 Learning: 2025-10-18T12:22:11.415ZApplied to files:
📚 Learning: 2025-10-18T12:22:42.070ZApplied to files:
📚 Learning: 2025-10-18T12:22:11.415ZApplied to files:
📚 Learning: 2025-10-18T12:22:42.070ZApplied to files:
📚 Learning: 2025-10-18T12:22:11.415ZApplied to files:
🧬 Code graph analysis (2)src/hooks/useAuth.ts (2)
tests/hooks/useAuth.test.tsx (1)
🔇 Additional comments (4)
Tip 📝 Customizable high-level summaries are now available in beta!You can now customize how CodeRabbit generates the high-level summary in your pull requests — including its content, structure, tone, and formatting.
Example instruction:
Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later. Comment |
|
Hey @emilianocalzada, Thanks for your contribution. Don't have much time these days sorry. Will try to take a look at it this week-end. Regards |
Fixes issue where
useAuthreturns stale user data after screen navigation. WhenrefreshOnMountistrue, the hook callsauthRefresh()on mount to fetch the latest user data from the server.Changes Made:
1:
src/types/useAuth.type.ts- Added therefreshOnMountoption toUseAuthOptions:2:
src/hooks/useAuth.ts- Added auseEffectthat callsauthRefresh()on mount whenrefreshOnMount: true:3:
tests/hooks/useAuth.test.tsx- Added 4 new tests for the refreshOnMount feature.Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.