Skip to content

fix(auth): notify password recovery from verify_otp and pkce exchanges - #2057

Merged
spydon merged 2 commits into
mainfrom
lukasklingsbo/sdk-2818-auth-emit-password-recovery
Nov 16, 2026
Merged

spydon merged 2 commits into
mainfrom
lukasklingsbo/sdk-2818-auth-emit-password-recovery

Conversation

@spydon

@spydon spydon commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

Apps listening for PASSWORD_RECOVERY to show a "set a new password" screen never saw it on v3.

  • verify_otp with type="recovery" emits PASSWORD_RECOVERY instead of SIGNED_IN.
  • exchange_code_for_session emits PASSWORD_RECOVERY when the verifier carries the /PASSWORD_RECOVERY suffix, whether it was stored by reset_password_for_email or passed in explicitly.
  • Both clients, with unit tests for the OTP types and the PKCE flows.

SDK-2818

@coderabbitai

coderabbitai Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

Explain Change →

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 23 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 8 included reviews currently available.

Learn how review limits work.

Review configuration:

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: b4ed475c-5ff1-4376-ac2f-032e1cb0b43e
Commits

Reviewing files that changed from the base of the PR and between cf38e13 and 70f07b7.

Files selected for processing: 3

  • src/auth/src/supabase_auth/client.py
  • src/auth/tests/_async/test_verify_otp.py
  • src/auth/tests/_sync/test_verify_otp.py

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • Bug Fixes
    • Password recovery flows now emit a PASSWORD_RECOVERY auth-state notification, while other code-exchange and OTP verification flows emit SIGNED_IN.
    • Auth-state notifications now include the updated session, keeping the reported state consistent with the session returned and stored after verification.

Async and sync PKCE code exchanges and OTP verification now emit PASSWORD_RECOVERY for recovery flows and SIGNED_IN otherwise. Session-saving helpers accept the selected event. Tests cover event order and session consistency for both client types.

Possibly related PRs

Change: Bug fix

Merge Risk: Minimal · previous review cf38e

This change makes password-recovery flows emit PASSWORD_RECOVERY instead of SIGNED_IN, and other flows are unchanged. No merge-blocking risk was identified, and both the async and sync clients have tests for the new events.

- [ ] 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: 0e1ba847-8aea-482d-b453-cbcafa03c3d7
Commits

Reviewing files that changed from the base of the PR and between 569e6fa and cf38e13.

Files selected for processing: 5

  • src/auth/src/supabase_auth/client.py
  • src/auth/tests/_async/test_pkce_code_challenge.py
  • src/auth/tests/_async/test_verify_otp.py
  • src/auth/tests/_sync/test_pkce_code_challenge.py
  • src/auth/tests/_sync/test_verify_otp.py

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

@spydon
spydon merged commit e05176b into main Nov 16, 2026
26 checks passed
@spydon
spydon deleted the lukasklingsbo/sdk-2818-auth-emit-password-recovery branch November 16, 2026 10:03
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