Repository navigation
Dashboard sign-in via GitHub device flow for relay-enrolled instances on any host #3867
Description
Problem
A relay-enrolled instance (the zero-config ProPR App / Connect path, PROPR_GH_RELAY_URL + PROPR_GH_RELAY_TOKEN) has no usable dashboard sign-in on any host other than loopback. resolveBrowserAuthMode (packages/api/connectAuth.ts) returns:
connectonly with a hosted Connect tunnel, or with a loopback callback;githubonly with the instance's own OAuth client;disabledotherwise.
So an instance on https://<app>.fly.dev, a VPS, or https://propr.internal.com needs its own GitHub OAuth App just to let people sign in. Because of this:
propr deploy flyrefuses relay-only deploys without the tunnel flags (packages/cli/src/commands/deploy/flyBrowserAuth.ts);- the Fly dashboard wizard (Deploy ProPR from the Fly.io dashboard (Launch an App → From GitHub), with first-visit setup #3827 / PR [3827 by Claude Opus 5.5] Deploy ProPR from the Fly.io dashboard (Launch an App → From GitHub), with first-visit setup #3852) has to ask for an OAuth App on its ProPR App path.
ui.gitfix.dev isn't affected: it owns propr-dev and signs in with that App's secret.
Solution: GitHub device flow sign-in
The device flow needs only the shared App's public client ID (propr-dev, Iv23liTCmmSNYyD0NtZA): no client secret and no callback URL. So it works on any hostname, port or private network, and ProPR's hosted services never handle the user token.
- New browser sign-in mode
device.resolveBrowserAuthModepicks it automatically for relay-enrolled instances that have neither their own OAuth client nor a usable Connect callback, instead ofdisabled.- It can also be chosen explicitly with
PROPR_WEB_AUTH_MODE=device. - Keep the existing modes and their precedence otherwise. ui.gitfix.dev-style
githubmode is unchanged.
- Flow.
- Login page: "Sign in with GitHub" → the API requests a device code (
POST https://github.com/login/device/code, the client ID, no scopes beyond what sign-in needs). - The UI shows the user code with a copy button, plus a link that opens
https://github.com/login/device. - The API polls
https://github.com/login/oauth/access_token, honouringinterval/slow_down/expires_in. - On success it calls
GET /userand checks the user against the installation the same way the Connect path does today: the user must have access to the relay's installation. The user–installation check must be equivalent to Connect's, not weaker. - Then it creates the normal session.
- Show the user code only to the browser that started the flow: bind it to a pending-login cookie, and use one code per attempt.
- Rate-limit starts per IP and per session.
- Login page: "Sign in with GitHub" → the API requests a device code (
- Tokens. Treat the returned user token like the Connect path does: same use, same lifetime and renewal behavior where it applies (refresh token if the App issues expiring tokens), encrypted at rest. Never log it.
- Discovery of the client ID. Ship the shared App's client ID as a default, next to
DEFAULT_PROPR_GH_RELAY_URL(packages/shared/src/proprServiceUrls.ts). Allow an override (PROPR_GH_DEVICE_CLIENT_ID), for example for a self-hosted relay with its own App. - Clear errors.
device_flow_disabledfrom GitHub → "Device sign-in isn't enabled for this GitHub App". Also handleaccess_denied, expired codes, and a user without installation access. - Callers.
propr deploy fly's browser-auth check accepts relay-only deploys (sign-in = device), with no tunnel or OAuth client required.- The Fly dashboard wizard on the ProPR App path drops the OAuth App step. Coordinate with [3827 by Claude Opus 5.5] Deploy ProPR from the Fly.io dashboard (Launch an App → From GitHub), with first-visit setup #3852: if it merges first, this PR removes that step; if this merges first, [3827 by Claude Opus 5.5] Deploy ProPR from the Fly.io dashboard (Launch an App → From GitHub), with first-visit setup #3852 uses it.
- Relay enrollment in the [3827 by Claude Opus 5.5] Deploy ProPR from the Fly.io dashboard (Launch an App → From GitHub), with first-visit setup #3852 wizard and in the CLI can use the same device-flow helper to get the one-time user token, instead of a pasted token or
gh.
- Prerequisite (operator action): Device Flow has to be enabled on the
propr-devGitHub App. Until it is, GitHub returnsdevice_flow_disabled. Tests mock GitHub; the live check happens once it's on.
Acceptance
- Unit and integration tests:
- mode resolution for every combination (own OAuth client, a tunnel, loopback, relay-only on a public host, relay-only on a private host);
- the device flow (
authorization_pending,slow_down,expired_token,access_denied,device_flow_disabled); - the installation access check;
- session creation;
- the token never appearing in logs or responses.
- UI: the login page in device mode, light and dark, with the code, copy, the link, a waiting state and errors.
- Docs: self-hosting / GitHub auth / Fly docs explain the device sign-in, when it's used, and how operators of their own App enable it.
- Live (once Device Flow is on): a relay-only instance on
https://<app>.fly.devsigns a browser in with no OAuth App of its own. Also check one non-Fly public host, or an internal hostname reached through a private network.
Activity
propr-dev commentedon Nov 27, 2026
🤖 AI processing has started for this issue using claude agent with claude-opus-5-5 model.
I'll analyze the problem and work on a solution. This may take a few minutes.
Processing Details:
claudeclaude-opus-5-53867/claude-opus-5-5-dashboard-sign-in-via-git-20261127-2345-km73758-epic-runtime-abstraction-sc0issue-3867-20261127-2345-claude-opus-5-5-km7🔍 Track Task Execution
chore: use GitHub device flow for wizard enrollment via ProPR App
integry commentedon Dec 1, 2026
Done in #3868, which merged into the runtime epic; the epic merged into
mainwith #3774 and ships in 0.9.4.