fix: AuthData validation incorrectly triggered on unchanged providers#10025
fix: AuthData validation incorrectly triggered on unchanged providers#10025
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. ✨ Finishing touches🧪 Generate unit tests (beta)
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 |
|
🚀 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.55% 92.54% -0.01%
==========================================
Files 190 190
Lines 15490 15499 +9
Branches 176 176
==========================================
+ Hits 14336 14343 +7
- Misses 1142 1144 +2
Partials 12 12 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@coderabbitai is this a breaking change? |
|
Tip For best results, initiate chat on the files or code changes.
Here's why:
Behavioral change clarification: While this is a behavioral change in how mutation detection works, it's not "breaking" in the conventional sense because:
The only theoretical edge case would be if someone had a custom auth adapter that relied on re-validation when non- |
## [9.2.1-alpha.2](9.2.1-alpha.1...9.2.1-alpha.2) (2026-02-06) ### Bug Fixes * AuthData validation incorrectly triggered on unchanged providers ([#10025](#10025)) ([d3d6e9e](d3d6e9e))
|
🎉 This change has been released in version 9.2.1-alpha.2 |
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.