-
Notifications
You must be signed in to change notification settings - Fork 56
feat: Add allowedBrowsers parameter to logout API #726
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds the allowedBrowsers parameter to the logout method of the WebAuthentication class, bringing it to parity with the existing login method. This Android-only feature enables developers to specify an allowlist of browser packages for the logout operation.
Changes:
- Added
allowedBrowsersparameter to Dart'sWebAuthentication.logout()method andWebAuthLogoutOptionsclass - Updated Android's
LogoutWebAuthRequestHandlerto handleallowedBrowsersand configureCustomTabsOptionswithBrowserPicker - Added comprehensive unit tests across Flutter and Android platforms
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| auth0_flutter/lib/src/mobile/web_authentication.dart | Added allowedBrowsers parameter to logout() method signature and implementation |
| auth0_flutter_platform_interface/lib/src/web-auth/web_auth_logout_options.dart | Added allowedBrowsers field to WebAuthLogoutOptions class and included it in toMap() serialization |
| auth0_flutter/android/src/main/kotlin/com/auth0/auth0_flutter/request_handlers/web_auth/LogoutWebAuthRequestHandler.kt | Implemented allowedBrowsers handling using CustomTabsOptions and BrowserPicker |
| auth0_flutter/test/mobile/web_authentication_test.dart | Added three test cases covering different scenarios for allowedBrowsers parameter |
| auth0_flutter_platform_interface/test/method_channel_auth0_flutter_web_auth_test.dart | Added tests for allowedBrowsers serialization and default behavior |
| auth0_flutter/android/src/test/kotlin/com/auth0/auth0_flutter/LogoutWebAuthRequestHandlerTest.kt | Added three Kotlin unit tests for allowedBrowsers handling |
| auth0_flutter/example/android/app/build.gradle | Updated manifest placeholders to use string resources instead of hardcoded values |
| auth0_flutter/example/android/app/src/main/res/values/strings.xml.example | Deleted example configuration file |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Description
This PR adds the
allowedBrowsersparameter to thelogoutmethod of theWebAuthenticationclass, bringing it to parity with theloginmethod.Closes #724
Changes
allowedBrowsersparameter toWebAuthentication.logout()methodTests
allowedBrowsersinweb_authentication_test.dartmethod_channel_auth0_flutter_web_auth_test.dartLogoutWebAuthRequestHandlerTest.ktUsage Example
Behavior
allowedBrowsersis empty (default), no browser restrictions are appliedChecklist