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:
5
.changeset/fn-4554-github-copilot-device-code.md
Normal file
5
.changeset/fn-4554-github-copilot-device-code.md
Normal 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.
|
||||||
@@ -411,6 +411,19 @@ Recovery entrypoints in the dashboard:
|
|||||||
|
|
||||||
### Authentication troubleshooting (mobile OAuth fallback)
|
### 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:
|
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.
|
- 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.
|
- 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.
|
||||||
|
|||||||
@@ -803,17 +803,20 @@ export const registerAuthRoutes: ApiRouteRegistrar = (ctx) => {
|
|||||||
// Start login flow in background — don't await the full login
|
// Start login flow in background — don't await the full login
|
||||||
const loginPromise = storage.login(provider, {
|
const loginPromise = storage.login(provider, {
|
||||||
onAuth: (info) => {
|
onAuth: (info) => {
|
||||||
const deviceCode =
|
const parsedUserCode =
|
||||||
provider === "github-copilot" && info.instructions
|
provider === "github-copilot" && info.instructions
|
||||||
? {
|
? parseGitHubCopilotDeviceCode(info.instructions)
|
||||||
userCode: parseGitHubCopilotDeviceCode(info.instructions),
|
|
||||||
verificationUri: info.url,
|
|
||||||
}
|
|
||||||
: undefined;
|
: undefined;
|
||||||
|
const deviceCode = parsedUserCode
|
||||||
|
? {
|
||||||
|
userCode: parsedUserCode,
|
||||||
|
verificationUri: info.url,
|
||||||
|
}
|
||||||
|
: undefined;
|
||||||
authResolve({
|
authResolve({
|
||||||
url: info.url,
|
url: info.url,
|
||||||
instructions: appendManualCodeHint(info.instructions, provider, origin),
|
instructions: appendManualCodeHint(info.instructions, provider, origin),
|
||||||
deviceCode: deviceCode?.userCode ? deviceCode : undefined,
|
deviceCode,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
onPrompt: async (_prompt) => {
|
onPrompt: async (_prompt) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user