Feature/auth fixes and react sdk tests#241
Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (14)
📒 Files selected for processing (42)
📝 WalkthroughWalkthroughThis PR introduces the React SDK package ( ChangesReact SDK and Auth Enhancements
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Suggested labels
Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint skipped: no ESLint configuration detected in root package.json. To enable, add Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
📝 Summary
This PR addresses critical vulnerabilities in the authentication flows, patches a concurrency race condition in the OAuth exchange, stabilizes the
@urbackend/reactSDK by completing its social auth flow, and introduces comprehensive unit testing for the React components. Furthermore, all SDKs and repository documentation have been updated to reflect the latest state.🐛 Bug Fixes & Security Patches
403status. The endpoint now returns a generic success response for soft-deleted users, perfectly mimicking non-existent accounts to prevent enumeration attacks.userAuth.controller.js). Replaced the sequentialredis.get()andredis.del()logic with an atomicredis.getdel()operation to prevent replay attacks during concurrent requests.<UrProvider />wherertCodewas ignored. The provider now correctly extractsrtCodefrom query parameters andtokenfrom the URL fragment, executingauth.socialExchange({ token, rtCode })to ensure long-lived sessions are reliably established even in strict cross-site cookie environments.✨ Enhancements & Testing
@urbackend/reactSDK, specifically targetingcontext.test.tsx(Logic & Auth flows) andUrAuth.test.tsx(UI behavior). All tests are passing.README.md&auth.py) to correctly reflect that the social authtokenrelies in the URL fragment (#token=...), not the query string.@urbackend/sdk(auth.ts).AGENTS.mdwith the new SDK ecosystem, testing commands, and atomic Redis patterns.📦 Chore / Release
packages/*,apps/*, and@urbackend/sdk.@urbackend/reactversion tov0.1.0following standard urBackend naming conventions for new packages.urbackend) tov0.1.1.GETDELcommand. Please ensure the production Redis instance is running Version 6.2.0 or higher before deploying this PR. No database schema migrations are required.Summary by CodeRabbit
New Features
Bug Fixes
Style
Documentation
Chores