Skip to content

Tony/630 try another webid#41

Merged
gjwgit merged 3 commits into
devfrom
tony/630_try_another_webid
May 20, 2026
Merged

Tony/630 try another webid#41
gjwgit merged 3 commits into
devfrom
tony/630_try_another_webid

Conversation

@tonypioneer
Copy link
Copy Markdown
Collaborator

@tonypioneer tonypioneer commented May 15, 2026

Pull Request Details

Description

Added cancelAuthenticate() and AuthCancelledException so callers can abort a stuck desktop OAuth flow when the user closes the browser window before completing login.

Related Issues

anusii/solidpod#630

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How To Test?

Run RioPod using tony/630_try_another_webid branch to test, and follow the steps below.

  • Started RioPod and clicked on "Try another WebID"
  • Close the web browser. The app were still showing the loading animation.
  • Then clicked on the Cancel button, and clicked on "Try another WebID" again.
  • The web browser popped up again, and see messages in CLI.

Checklist

  • Screenshots included in linked issue #
  • Changes adhere to the style and coding guidelines
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • Any dependent changes have been merged and published in downstream modules
  • The update contains no confidential information
  • The update has no duplicated content
  • No lint check errors are related to these changes (make prep or flutter analyze lib)
  • Integration test dart test output or screenshot included in issue #
  • I tested the PR on these devices:
    • Android
    • iOS
    • Linux
    • MacOS
    • Windows
    • Web
  • I have identified reviewers
  • The PR has been approved by reviewers

Finalising

  • Merge dev into the this branch
  • Resolve any conflicts
  • Add a one line summary into the CHANGELOG.md
  • Push to the git repository and review
  • Merge the PR into dev

…ort a stuck desktop OAuth flow when the user closes the browser window before completing login. Authenticator.cancel() is now idempotent and only tears down the shared callback server when no other flow needs it
…ort a stuck desktop OAuth flow when the user closes the browser window before completing login. Authenticator.cancel() is now idempotent and only tears down the shared callback server when no other flow needs it
Copy link
Copy Markdown
Contributor

Copilot AI left a 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 cancellation support for non-web OAuth authentication flows so callers can abort a pending login and distinguish cancellation from other failures.

Changes:

  • Adds AuthCancelledException, cancelAuthenticate(), and pending-authenticator tracking.
  • Updates desktop/mobile OAuth cancellation handling to complete the pending flow and close callback servers when appropriate.
  • Minor wording cleanup in pubspec.yaml.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
pubspec.yaml Clarifies a dependency-checker comment.
lib/src/openid/openid_client_io.dart Updates Authenticator.cancel() to be idempotent and server-aware.
lib/solid_auth_client.dart Adds public authentication cancellation APIs and maps cancellation errors to AuthCancelledException.

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

Comment on lines +149 to +151
final completer = _requestsByState.remove(state);
if (completer != null && !completer.isCompleted) {
completer.completeError(Exception('Flow was cancelled'));
Comment on lines +157 to +158
if (_requestsByState.isEmpty) {
final serverFuture = _requestServers.remove(port);
Comment thread lib/solid_auth_client.dart Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@gjwgit gjwgit requested review from anushkavidanage and srodriguez142857 and removed request for gjwgit May 18, 2026 03:53
Copy link
Copy Markdown
Collaborator

@srodriguez142857 srodriguez142857 left a comment

Choose a reason for hiding this comment

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

All went smoothly in my tests; the functionality is working as expected.
Thanks @tonypioneer.

@gjwgit gjwgit merged commit becd606 into dev May 20, 2026
18 of 20 checks passed
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.

4 participants