Skip to content

Use a system auth session to login#3270

Merged
veloce merged 4 commits into
mainfrom
web_auth
Jun 3, 2026
Merged

Use a system auth session to login#3270
veloce merged 4 commits into
mainfrom
web_auth

Conversation

@veloce

@veloce veloce commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Migrated the auth flow to use an ASWebAuthenticationSession on iOS, and Chrome Auth Tab on Android (through flutter_web_auth_2 package).

Prepare the app to support an https://lichess.org/account/oauth/mobile-callback login callback URI on android.

@veloce veloce changed the title Use an auth session to login Use an auth session / Auth Tab to login Jun 2, 2026
@veloce veloce changed the title Use an auth session / Auth Tab to login Use a system auth session to login Jun 2, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Migrates the mobile OAuth sign-in flow to use platform-provided system authentication sessions via flutter_web_auth_2, removing the prior app-links-based callback plumbing and preparing Android for an HTTPS App Link callback route.

Changes:

  • Reworked AuthRepository.signIn() to use FlutterWebAuth2.authenticate() with PKCE + state validation, with a gated option for an HTTPS App Link redirect URI on Android.
  • Removed the Riverpod OAuth callback stream wiring from app links handling (and deleted the associated provider).
  • Added focused unit tests for the new sign-in flow and updated dependencies / generated plugin registrants accordingly.

Reviewed changes

Copilot reviewed 10 out of 11 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
test/model/auth/auth_repository_test.dart Adds unit tests for the new flutter_web_auth_2-based sign-in flow (success + error paths).
pubspec.yaml Adds flutter_web_auth_2 and the platform interface (for test fakes).
pubspec.lock Locks new direct + transitive deps introduced by flutter_web_auth_2.
linux/flutter/generated_plugins.cmake Registers newly introduced desktop plugins (generated).
linux/flutter/generated_plugin_registrant.cc Registers newly introduced desktop plugins (generated).
lib/src/model/auth/oauth_callback.dart Removes the old OAuth redirect stream provider (no longer used).
lib/src/model/auth/auth_repository.dart Implements sign-in via system auth session; adds gated HTTPS callback path support.
lib/src/app_links_service.dart Removes forwarding of OAuth callback links into the old stream provider.
android/app/src/main/kotlin/org/lichess/mobileV2/OAuthCallbackActivity.kt Removes the old trampoline activity for OAuth callbacks.
android/app/src/main/kotlin/org/lichess/mobileV2/MainActivity.kt Updates deep-link handling comment; OAuth callbacks now handled by the plugin activity/session.
android/app/src/main/AndroidManifest.xml Switches OAuth callback receiver to flutter_web_auth_2’s CallbackActivity and adds HTTPS App Link intent-filter.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

// LichessBinding does not provide.
TestWidgetsFlutterBinding.ensureInitialized();

group('AuthRepository.signIn', () {
@veloce veloce marked this pull request as ready for review June 3, 2026 07:41
@veloce veloce merged commit 92d97a8 into main Jun 3, 2026
1 check passed
@veloce veloce deleted the web_auth branch June 3, 2026 13:16
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.

2 participants