Skip to content

fix(auth): port the v2 response parsing fixes - #2058

Merged
spydon merged 2 commits into
mainfrom
lukasklingsbo/sdk-2822-auth-port-v2-response-parsing-fixes
Nov 16, 2026
Merged

spydon merged 2 commits into
mainfrom
lukasklingsbo/sdk-2822-auth-port-v2-response-parsing-fixes

Conversation

@spydon

@spydon spydon commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

Ports the four v2 auth parsing fixes to v3. SDK-2822

@coderabbitai

coderabbitai Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • New Features
    • OTP verification now handles secure email-change confirmations, including pending confirmations and responses containing user or session details.
    • MFA factor listings preserve phone numbers for phone factors.
    • OAuth clients can be listed and retrieved when a client name is not provided.
  • Bug Fixes
    • Retryable authentication errors retain the original status and, when available, the response message.

The OTP verification parser now handles pending secure email-change responses and continues to use the general parser for other responses. Factor includes an optional phone number, and OAuthClient.client_name is optional. Sync and async tests cover these response and model cases. Helper tests also cover retryable responses with empty, HTML, and parseable JSON bodies.

Sequence Diagram(s)

sequenceDiagram
  participant AuthClient
  participant VerifyOtpParser as _parse_verify_otp_response
  participant AuthResponseParser as parse_auth_response
  AuthClient->>VerifyOtpParser: response and OTP parameters
  alt pending secure email-change response
    VerifyOtpParser-->>AuthClient: empty AuthResponse
  else other response
    VerifyOtpParser->>AuthResponseParser: response
    AuthResponseParser-->>VerifyOtpParser: parsed AuthResponse
    VerifyOtpParser-->>AuthClient: parsed AuthResponse
  end
Loading

Possibly related PRs

  • supabase/supabase-py#1933: Changes session handling in verify_otp() for responses without a session, adjacent to this PR’s response parsing changes.
  • supabase/supabase-py#1845: Changes verify_otp() to accept the pending secure email-change response marker, the same parsing behavior covered here.

Change: Bug fix

Merge Risk: Minimal · up to 60b0f

This change ports small auth parsing fixes: a pending secure email-change confirmation returns an empty response, phone factors carry a phone number, and OAuth clients may lack a name. The changes are narrow and backward compatible, and they come with tests. No merge-blocking risk was identified.

- [ ] Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 023004a0-a183-4eb8-9d1a-6e261dd5f6b8
Commits

Reviewing files that changed from the base of the PR and between 7e1a0005b3a460e300cfc2bfb774e6641a70ef7f and 60b0fca.

Files selected for processing: 8

  • src/auth/src/supabase_auth/client.py
  • src/auth/src/supabase_auth/helpers.py
  • src/auth/src/supabase_auth/types.py
  • src/auth/tests/_async/test_oauth_client_list.py
  • src/auth/tests/_async/test_verify_otp.py
  • src/auth/tests/_sync/test_oauth_client_list.py
  • src/auth/tests/_sync/test_verify_otp.py
  • src/auth/tests/test_helpers.py

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 0 remain after this review.

@spydon
spydon force-pushed the lukasklingsbo/sdk-2822-auth-port-v2-response-parsing-fixes branch from 8a039a1 to 60b0fca Compare November 16, 2026 10:05
@spydon
spydon merged commit 16825e8 into main Nov 16, 2026
26 checks passed
@spydon
spydon deleted the lukasklingsbo/sdk-2822-auth-port-v2-response-parsing-fixes branch November 16, 2026 10:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant