fix(auth): decode MFA unenroll responses with id key#905
Conversation
📝 WalkthroughWalkthroughAuthMFAUnenrollResponse's public property was renamed from Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 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 |
|
Hey @kkarlsen06, thanks for the PR, but let's go with only the Can you update your PR to accept only the |
d92f0f2 to
746a3d4
Compare
|
Done, @grdsdev. Simple, minimal diff, with breaking changes as per your request. |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@Tests/AuthTests/AuthClientTests.swift`:
- Around line 1807-1808: The mock response in the failing test uses statusCode
204 but provides a JSON body, which contradicts HTTP semantics and breaks the
SDK's unenroll decoding (AuthMFA.unenroll calls .decoded(decoder:)); update the
mock in AuthClientTests.swift to use statusCode 200 so the mock returns a
successful JSON payload that the unenroll call can decode correctly and aligns
with the SDK contract.
746a3d4 to
00f1a75
Compare
|
@kkarlsen06 please run |
00f1a75 to
7c555a0
Compare
Summary
factorIdtoidinAuthMFAUnenrollResponseto match the GoTrue API response shape ({"id":"..."})Why
The GoTrue
UnenrollFactorResponsestruct serializes as{"id":"..."}(source), but the Swift SDK was decoding it asfactor_id, causing a decoding mismatch.Test plan
swift test --filter AuthClientTests/testMFAUnenrollCloses #904
Summary by CodeRabbit
Refactor
factorIdtoid. This is a breaking change for integrations that read the unenroll response.Tests
id).