feat(FN-4554): complete Step 6 — docs and changeset

Fusion-Task-Id: FN-4554
Fusion-Task-Lineage: 12d517c5-1954-4b27-8c63-c7f0dde93d3f
This commit is contained in:
Fusion
2026-05-14 21:41:16 -07:00
committed by gsxdsm
parent dc46a68b6e
commit 67f2757c33
3 changed files with 27 additions and 6 deletions

View File

@@ -0,0 +1,5 @@
---
"@runfusion/fusion": patch
---
Fix GitHub Copilot OAuth login hanging in Settings and Onboarding. The dashboard now auto-answers the enterprise-domain prompt (defaulting to github.com) and surfaces the device user code + verification URL so users can complete the device-code flow end to end.

View File

@@ -411,6 +411,19 @@ Recovery entrypoints in the dashboard:
### Authentication troubleshooting (mobile OAuth fallback)
#### `/api/auth/login` response shape for device-code providers
`POST /api/auth/login` returns:
- `url: string`
- `instructions?: string`
- `manualCode?: { prompt: string; placeholder?: string; helpText?: string }`
- `deviceCode?: { userCode: string; verificationUri: string }`
For `github-copilot`, Fusion auto-resolves the upstream enterprise-domain prompt to blank (`github.com` default), then returns `deviceCode` so Settings/Onboarding can render a dedicated “Enter this code on GitHub” panel.
Request body remains `{ provider: string, origin?: string }`. `enterpriseDomain` is reserved for future UX expansion and is not required for this flow.
When an OAuth provider returns a localhost callback that this dashboard host cannot open directly, use the **manual code** fallback in Settings/Onboarding:
- Tap **Login** for the provider, complete sign-in in the browser, then paste either the final redirect URL or the authorization code into the fallback textbox. Fusion now shows a pre-login warning first so you know to copy the browser address bar URL before the redirect tab appears to fail.
- On mobile/coarse-pointer layouts, the fallback textbox now auto-scrolls into view on focus (and after keyboard viewport shifts) so the paste/submit path remains usable.

View File

@@ -803,17 +803,20 @@ export const registerAuthRoutes: ApiRouteRegistrar = (ctx) => {
// Start login flow in background — don't await the full login
const loginPromise = storage.login(provider, {
onAuth: (info) => {
const deviceCode =
const parsedUserCode =
provider === "github-copilot" && info.instructions
? {
userCode: parseGitHubCopilotDeviceCode(info.instructions),
verificationUri: info.url,
}
? parseGitHubCopilotDeviceCode(info.instructions)
: undefined;
const deviceCode = parsedUserCode
? {
userCode: parsedUserCode,
verificationUri: info.url,
}
: undefined;
authResolve({
url: info.url,
instructions: appendManualCodeHint(info.instructions, provider, origin),
deviceCode: deviceCode?.userCode ? deviceCode : undefined,
deviceCode,
});
},
onPrompt: async (_prompt) => {