Skip to content

Fix OAuth connection overwriting existing connections - #1541

Merged
RhysSullivan merged 2 commits into
UsefulSoftwareCo:mainfrom
baggiiiie:fix/oauth-conn
Aug 5, 2026
Merged

Fix OAuth connection overwriting existing connections#1541
RhysSullivan merged 2 commits into
UsefulSoftwareCo:mainfrom
baggiiiie:fix/oauth-conn

Conversation

@baggiiiie

Copy link
Copy Markdown
Contributor

Fix OAuth connect overwriting an existing connection instead of adding a second

Make connectionIdentifier idempotent with a fast path for names it already emits, and normalize the requested name in oauth.start so the free-name guard compares the exact string the mint stores. A second connect for the same integration now resolves to a suffixed name (e.g. localGmail2) instead of re-minting the first account's row.

changes:

  • connection-name-identifier.ts: make connectionIdentifier idempotent. Fast-path inputs that are already in the tokenizer's output range, a lower letter followed by alphanumerics, and return them unchanged before tokenizing
  • oauth-service.ts: normalize the requested name before the guard, leaves the mint free to mutate the name again on its second pass.

Fixes #1540

baggiiiie and others added 2 commits August 6, 2026 01:18
…g a second

Make connectionIdentifier idempotent with a fast path for names it already
emits, and normalize the requested name in oauth.start so the free-name guard
compares the exact string the mint stores. A second connect for the same
integration now resolves to a suffixed name (e.g. localGmail2) instead of
re-minting the first account's row.

Fixes UsefulSoftwareCo#1540
@RhysSullivan
RhysSullivan merged commit 8ba64f6 into UsefulSoftwareCo:main Aug 5, 2026
13 checks passed
@RhysSullivan RhysSullivan mentioned this pull request Aug 5, 2026
@baggiiiie
baggiiiie deleted the fix/oauth-conn branch August 5, 2026 22:11
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.

OAuth connect overwrote existing ones instead of adding a second connection

2 participants