fix(provider): fall back to returnTo for Auth Tab logout scheme#1026
Merged
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughAuth Tab redirect resolution now falls back to ChangesAuth Tab redirect handling
Estimated code review effort: 1 (Trivial) | ~5 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 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 |
subhankarmaiti
approved these changes
Jul 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
WebAuthProvider.logout(account).withAuthTab()could never succeed. When Auth Tab is used,CustomTabsController.launchAsAuthTabderives the redirect scheme from theredirect_uriquery parameter of the URL. The login flow always setsredirect_uri, but the logout flow only setsreturnTo— so the lookup returnednulland the SDK failed witha0.invalid_authorize_urlbefore the browser ever opened.Fix: In
launchAsAuthTab, fall back to thereturnToquery parameter whenredirect_uriis absent, so the Auth Tab logout flow can resolve a scheme. Login behavior is unchanged (it always hasredirect_uri).CustomTabsController.launchAsAuthTab(...)(package-private, internal) — added areturnTofallback for scheme resolution.LogoutBuilder.withAuthTab()option; no new usage patterns are introduced.References
SDK-9834
Testing
Added a unit test covering the logout case where only
returnTois present, verifying the Auth Tab is launched (rather than failing witha0.invalid_authorize_url). The existingCustomTabsControllerTestsuite continues to pass (19/19). Also verified end-to-end on a physical device (Pixel 7a) against a real Auth0 tenant: tapping "Log out (Auth Tab)" launched the browser and returnedonSuccesswith no error.Reviewers can verify by:
Running
./gradlew :auth0:testReleaseUnitTestand confirmingCustomTabsControllerTestpasses, includingshouldLaunchAsAuthTabUsingReturnToWhenRedirectUriIsAbsent.Optionally, wiring
WebAuthProvider.logout(account).withScheme(...).withAuthTab().start(...)in a sample app on a device with an Auth Tab–capable browser and confirming logout completes.This change adds unit test coverage
This change adds integration test coverage
This change has been tested on the latest version of the platform/language or why not
Checklist
I have read the Auth0 general contribution guidelines
I have read the Auth0 Code of Conduct
All existing and new tests complete without errors
Summary by CodeRabbit
redirect_uribut provide areturnToparameter.