fix(app): GitHub sign-in on Linux and Windows waits for the browser
Signing in with GitHub on Linux ended in "Unable to connect" at 127.0.0.1:43823 after authorizing. flutter_web_auth_2 (v5.1.0, unchanged on its master) ends every pending sign-in when the app is resumed. That suits mobile, where coming back without finishing means giving up, but on the desktop the window regaining focus resumes the app, and the package's loopback server closed before GitHub sent the browser back. FluffyChat's issue #3341 and the package's #171 report the same. The app now puts its own Linux and Windows implementation behind the package's platform interface (LoopbackWebAuth): the system browser and a loopback address, as RFC 8252 recommends, waiting until GitHub answers, the person cancels, or five minutes pass. It listens on 127.0.0.1 only and answers only the callback's path. Serverpod's PKCE and state check stay in use. There, the account dialog shows "Continue in your browser." with a Cancel button, and closing the dialog cancels the sign-in. Serverpod (v4.0.3) reports a cancelled browser round trip as an unknown error, so the gateway knows a cancel by having asked for it. A cancel on GitHub's own page, or leaving the browser on Android, still reads as a failure; AGENTS.md says so. The regression test drives the package's front through a change of focus. With the package's behaviour it fails with the same refused connection. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
This commit is contained in:
parent
807dbbfa06
commit
4ab78d5547
1 changed files with 703 additions and 8 deletions
|
|
@ -36,6 +36,10 @@ dependencies:
|
|||
flutter:
|
||||
sdk: flutter
|
||||
flutter_bloc: ^9.1.1
|
||||
# The app's own browser half of GitHub sign-in on Linux and Windows
|
||||
# (LoopbackWebAuth) plugs in here, and opens the browser and brings the window
|
||||
# back with the same packages flutter_web_auth_2 uses.
|
||||
flutter_web_auth_2_platform_interface: ^5.0.0
|
||||
fractional_indexing_dart: ^1.0.7
|
||||
# Pinned exactly: every device on one app version must compute the same
|
||||
# schedules.
|
||||
|
|
@ -48,6 +52,8 @@ dependencies:
|
|||
serverpod_auth_idp_flutter: 4.0.3
|
||||
serverpod_flutter: 4.0.3
|
||||
serverpod_offline_sync_client: 0.0.8
|
||||
url_launcher: ^6.3.2
|
||||
window_to_front: ^0.0.4
|
||||
|
||||
dev_dependencies:
|
||||
fake_async: ^1.3.3
|
||||
|
|
@ -56,6 +62,8 @@ dev_dependencies:
|
|||
sdk: flutter
|
||||
flutter_test:
|
||||
sdk: flutter
|
||||
# A test drives sign-in through its front, as Serverpod's GitHub sign-in does.
|
||||
flutter_web_auth_2: ^5.1.0
|
||||
# The sync tests (test/sync/) sign in like the app and read the server's database.
|
||||
postgres: ^3.5.16
|
||||
serverpod_auth_core_client: 4.0.3
|
||||
|
|
|
|||
Loading…
Reference in a new issue