Skip to content

Conversation

@Namaneo
Copy link

@Namaneo Namaneo commented Dec 7, 2025

Removed the 'intentFlags' parameter from FlutterWebAuth2Options.

What does this PR do?

There's currently an issue on Android where, after opening an Auth Tab and switching apps, the authentication page is killed instead of being resumed. This breaks the authentication flow when say a 2FA code is required. This PR fixes this issue, and make the authentication page resume correctly after switching apps or going back to the app from the home screen.

To add more details, Appwrite Flutter SDK now uses flutter_web_auth_2 version 5.0.0 alpha. In recent releases, ephemeralIntentFlags has been deprecated in favor of preferEphemeral, which isn't required here since it has been there for a while for iOS, and would make the Auth Tab use a private session without existing logged in accounts.

Test Plan

Manual.

Related PRs and Issues

Fixes appwrite/sdk-for-flutter#181.

Have you read the Contributing Guidelines on issues?

Yes.

Summary by CodeRabbit

  • Refactor
    • Simplified internal authentication configuration by removing redundant option assignments. No changes to app functionality or user experience.

✏️ Tip: You can customize this high-level summary in your review settings.

Removed the 'intentFlags' parameter from FlutterWebAuth2Options.
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 7, 2025

Walkthrough

The change removes an explicit ephemeralIntentFlags assignment from the FlutterWebAuth2Options configuration in the webAuth call within the Flutter client template. The configuration now specifies only useWebview: false, allowing the omitted flag to use its default value. No modifications were made to method signatures, error handling, or control flow logic.

Estimated Code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

  • Verify that the default value for ephemeralIntentFlags is the correct intended behavior for the webAuth flow
  • Confirm this change does not affect Android-specific platform behavior
  • Ensure the omission is intentional and not a regression

Pre-merge checks and finishing touches

✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately reflects the main change: fixing the Android OAuth2 authentication flow to properly resume after app switching, which directly addresses the bug reported in the linked issue.
Linked Issues check ✅ Passed The code change removes ephemeralIntentFlags to allow the authentication page to resume properly after app switching, directly addressing the core requirement to prevent login cancellation when switching to authenticator apps.
Out of Scope Changes check ✅ Passed The pull request makes a focused change removing only the ephemeralIntentFlags parameter from FlutterWebAuth2Options, which is directly related to the stated objective and does not introduce any unrelated modifications.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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

Comment @coderabbitai help to get the list of available commands and usage tips.

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.

🐛 Bug Report: [Android] Switching to any authenticator app while creating a Google OAuth Session breaks the login flow

1 participant