-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
fix: AuthData validation incorrectly triggered on unchanged providers #10025
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: alpha
Are you sure you want to change the base?
Conversation
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
Co-authored-by: mtrezza <5673677+mtrezza@users.noreply.github.com>
Co-authored-by: mtrezza <5673677+mtrezza@users.noreply.github.com>
|
Important Review skippedBot user detected. To trigger a single review, invoke the You can disable this status message by setting the
📝 WalkthroughWalkthroughFixes authData validation logic to validate only providers with actual changes (id differences or unlinking) rather than all existing providers. Modifies mutation detection from deep equality checks to id-level comparison. Adds test cases validating multi-provider authentication flows where one provider is added while another remains unchanged. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
|
🚀 Thanks for opening this pull request! |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## alpha #10025 +/- ##
==========================================
- Coverage 92.54% 92.54% -0.01%
==========================================
Files 190 190
Lines 15489 15498 +9
Branches 176 176
==========================================
+ Hits 14335 14342 +7
- Misses 1142 1144 +2
Partials 12 12 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Pull Request
Issue
Multi-provider authData updates fail when code-based adapters strip sensitive fields via
afterFind(). Parse Server re-validates unchanged providers, but the stripped fields (e.g.,code) cause validation to fail.Root cause:
hasMutatedAuthData()usedisDeepStrictEqual()for change detection. WhenafterFind()strips fields, the deep comparison treats unchanged providers as mutated.Approach
The fix changes hasMutatedAuthData in Auth.js to use subset comparison.
Summary by CodeRabbit
Tests
Refactor
✏️ Tip: You can customize this high-level summary in your review settings.