Skip to content

fix(sign-in): open a pasted sign-in code from the popup (VTI-LNK-105 – 107) - #450

Merged
stormer78 merged 1 commit into
mainfrom
fix/pasted-sign-in-link
Nov 23, 2026
Merged

stormer78 merged 1 commit into
mainfrom
fix/pasted-sign-in-link

Conversation

@stormer78

@stormer78 stormer78 commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Problem

An assistant over vtc-mcp signs its own key in as the person with vtc_sign_in, which hands the person a sign-in trigger link. With the browser wallet, neither the member nor the admin audience could be completed:

  • the bridge has no page on the community's portal, so the link can't be clicked there, and a click anywhere else is wrong-origin (sign-in-flows.ts, !origin || !originMatchesPortal(...));
  • the popup's paste box accepted step-up links only.

A user setting up vtc-mcp hit exactly this and had to fall back to enrolling a signing key through the console.

Why this is spec-conformant

VTI-LNK-105 binds "a reader that recorded the origin of the page the link was activated from". A pasted code has no recorded origin, which is the footing of a code scanned with a camera. In that case the spec relies on the number the person enters (VTI-LNK-106 / 107 don't apply). The wallet was stricter than the spec here.

Change

The popup box (OpenPastedLink, now RUNTIME_PASTED_LINK, extension pages only) also takes a sign-in link. It opens the sign-in window with a flow record carrying pasted: true and no origin. For such a flow:

  • Nothing is skipped. The confirm screen is shown even for one identity, with a note that the code was pasted. No click on the portal stands for the go-ahead (VTI-LNK-106).
  • The person types the number. No page number is waited for or taken (pageNumber drops it; handleTriggerLinkNumber skips pasted records). The person enters the number the assistant shows, and the community checks it (VTI-LNK-107).
  • Only a community already in the records. A pasted code for an unknown site returns not-member, with no join or hosting offer and nothing sent.
  • No origin is pinned.

pasted is an explicit flag set only on the popup path. A click whose origin went missing is still wrong-origin, and a pasted flow that carries an origin is refused.

RUNTIME_STEP_UP_LINK is renamed to RUNTIME_PASTED_LINK (vta-wallet/pasted-link). The step-up behaviour is unchanged. CLAUDE.md has a new section on the pasted sign-in path.

Tests

  • sign-in-flows.test.mts: a missing origin without pasted is still wrong-origin. A pasted code keeps the confirm screen and sends nothing before Continue. A pasted code never takes a page number: it reaches enter-number at once even with a 60 s page wait, and the grant still names the verified portal origin. Pasted with an origin is refused. Pasted for an unknown community or DID host returns not-member with nothing sent.
  • sign-in-view.render.test.mts: a pasted confirm with one identity is not auto-claimed and shows the note.
  • npm run lint, npm run build and the extension suite pass (1573/1573).

Companion change: OpenVTC/verifiable-trust-infrastructure#2794 updates vtc_sign_in's instructions to say "paste it into the wallet popup".

Pre-merge checklist

  • No new reqwest::Client::new() / bare fetch(); all clients have finite timeouts (R1.2): no new network calls
  • No lock held across a network await (R1.3)
  • No local state committed before its remote effect, or the flow is resumable with an idempotency key (R2.1): the flow record is session storage, as before
  • Every retry is bounded + backed off; non-idempotent ops are not blind-retried (R1.4): no retries added
  • Accept/poll/listen loops survive transient errors (R1.5): n/a
  • Acks/deletes happen only after durable handoff (R1.6): n/a
  • New/changed wire types: camelCase, deny_unknown_fields where security-relevant, schema registered, all consumers (incl. JS) updated (R3.*): internal extension message renamed, all senders and receivers updated; no wire change to the community
  • Config absence = most restrictive; fail-closed if enforcement can't start (R5.*): a missing origin without the explicit pasted flag still refuses
  • Logs/status claim only what was verified; background-job failures are surfaced (R6.*)
  • "Process dies on the next line" answered for every mutation touched (R2.1): a lost worker loses the session-stored flow, and the person pastes again
  • Deviations from this guide flagged explicitly with rule numbers: none

…– 107)

An assistant over vtc-mcp signs its own key in as the person with
`vtc_sign_in`, which hands the person a `sign-in` trigger link. The bridge
has no page on the community's portal, so the link could never be clicked
there, and the popup's paste box took `step-up` links only. Neither the
member nor the admin audience could be completed with the browser wallet.

VTI-LNK-105 binds a reader that recorded an activation origin. A pasted
code has none, the same footing as a code scanned with a camera. The popup's
box (`OpenPastedLink`, `RUNTIME_PASTED_LINK`, extension pages only) now also
takes a `sign-in` link and opens the sign-in window with a flow record
carrying `pasted: true` and no origin. For such a flow:

- the confirm screen is never skipped, and says the code was pasted
  (no click on the portal stands for the go-ahead, VTI-LNK-106);
- no page number is waited for or taken, so the person types the number
  the assistant shows (VTI-LNK-107);
- only a community already in the wallet's records is signed in to; a site
  it does not know is `not-member`, with no join or hosting offer;
- no origin is pinned.

`pasted` is an explicit flag set only on the popup path. A click whose
origin went missing is still `wrong-origin`, and a pasted flow that carries
an origin is refused.

Signed-off-by: Glenn Gore <glenn.g@affinidi.com>
@stormer78
stormer78 merged commit ab99435 into main Nov 23, 2026
4 checks passed
@stormer78
stormer78 deleted the fix/pasted-sign-in-link branch November 23, 2026 19:29
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.

1 participant