Skip to content

fetch: retry the original request once a pending interaction flips to authorized #18

Description

@dickhardt

Observed repeatedly in the 2026-08-14 beta testing: @aauth/fetch drives the deferred flow (consent, chained connect) to completion, then prints {"status": "authorized"} and exits without re-issuing the original request with the token it just obtained.

Consequences beyond the obvious UX gap: on the write path the staged upstream connection is claimed at vend under the flow's R3 doc id — only the auth token from THIS flow can claim it. A user who re-runs the command mints a new doc, which cannot claim the old staging, so they are bounced through the upstream OAuth again (observed three consecutive HubSpot connects). The proxy has a partial server-side mitigation (hellocoop/aauth-proxy#32 claims staged connections before an escalation bounce), but the client should finish its own flow.

Fix: after the poll resolves with the token, replay the original method/URL/body with the obtained credential and print THAT response. {"status":"authorized"} should never be the final output of a request command.

🤖 Generated with Claude Code

https://claude.ai/code/session_01TQ2FCHHAnuJWF5TJB3838S

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions