Skip to content

Hosted /enroll: sign-in drops the enrollment, and its link can't be carried to another browser #1801

Open

Description

@nedtwigg

Signing in from Dormouse's enrollment link loses what the user came to do, and nothing lets them recover it except starting pairing over in Dormouse.

What happens

  1. In Dormouse, start Hosted remote control (or Natural Voice). Dormouse opens https://hosted.dormouse.sh/enroll#<userCode> in the OS default browser.
  2. That browser is signed out, so the page asks for a sign-in.
  3. After signing in, the page lands on /account. The enrollment is gone, and the user has to restart pairing in Dormouse to get a new link.

Moving the link to another browser — the one already signed in, or one an agent is watching — doesn't work either:

  • takeEnrollment (hosted/src/enrollment.ts) erases the fragment from the address bar before the first render, so the code shows for a moment at most and can't be copied.
  • Dormouse never shows the user code or the link itself, only the confirmation digits. The link exists only in the openExternal call.

Why

This is the documented behavior today. docs/specs/hosted.md → "Burrow enrollment": "hold the code in memory only: through email sign-in and back, never into storage. Provider sign-in leaves the page, so the user opens the link again." Opening the link again isn't possible, because Dormouse has no way to reopen it short of starting a new enrollment.

/checkout already handles the same problem: it keeps its plan and ref in sessionStorage for ten minutes so they survive a provider sign-in (docs/specs/hosted.md → "Identity and login").

Options

  • Keep the pending enrollment in sessionStorage until ENROLLMENT_TTL_MS expires, the way checkout does. The confirmation digits are shown only in Dormouse, so a stored code alone approves nothing. That makes the risk small, but it should still get a security review against the memory-only rule.
  • Give Dormouse a way to reopen or copy the current enrollment link while its code is live.

Also seen in the same walkthrough

  • An email-code send that got rate-limited (429 from send-verification-otp) showed "Too many attempts…" along with Retry connection, which describes a connection failure.
  • That banner stayed up after switching to "I already have a code".

Activity

  1. added
    bug
    on Nov 16, 2026
  2. dormouse-bot commented on Nov 16, 2026

    @dormouse-bot
    Collaborator

    #1802 fixes the two banner problems from the walkthrough: a 429 no longer offers Retry connection, and I already have a code clears the action's error the way Change email does. Each has a regression test that failed before the change. Every CI check passes except Argos, which flags one changed snapshot per browser. That snapshot is the Hosted/Sign-in → RateLimited story, which no longer shows the button, so it needs a maintainer to accept it.

    I left the enrollment loss alone, because both of your options change a rule in the spec. takeEnrollment and docs/specs/hosted.md → "Burrow enrollment" follow that rule exactly: the code is held in memory only, and a provider sign-in sends the user back to Dormouse for the link. So which option to take is your call:

    • sessionStorage until ENROLLMENT_TTL_MS. This mirrors checkout's intent and fixes the provider round-trip without any desktop change. It also needs that rule rewritten and a security review. The stored code would stay in that tab's storage after the user leaves the page.
    • Reopen or copy the link from Dormouse while the code is live. This also covers carrying the link to another browser, which storage alone can't, because the fragment is gone from the first browser. It does mean the desktop shows or re-sends the user code, which today exists only in the openExternal call.

    These don't exclude each other. Only the second fixes the "move it to another browser" half of this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions