fix(providers): complete OAuth logins that finish in the browser
OpenCode's authorize response reports how the client must finish: `code` expects a pasted code, while `auto` requires the client to call oauth/callback immediately and hold it open — upstream blocks in there polling for the device code or waiting on its loopback redirect, and only that call persists the credential. Every auth plugin OpenCode ships uses `auto`; none use `code`. The page implemented only `code`. It opened the browser, showed a paste field no provider can fill, and never called back, so a successful sign-in stored nothing and the app sat unchanged. Authorization now drives the UI: `auto` chains straight into the callback behind a waiting state with a cancel, and the paste field appears only when a provider actually asks for a code. Two smaller failures shared that surface. Prompts were never collected, which put GitHub Copilot Enterprise out of reach entirely, so a method that declares them now asks first and passes the answers to authorize. Device codes are also recovered from the instructions text, where they actually live — the old code read fields the API does not return, so the copy button never appeared. The callback is exempt from the ordinary proxy deadline and gets a 15-minute budget, bounded by the shortest upstream expiry we know of. A human sign-in with 2FA does not fit in four minutes, and expiring it turned a completed login into a 504.
This commit is contained in:
@@ -1359,6 +1359,17 @@ export const settingsDict = {
|
||||
"settings.providers.page.auth.apiKeyPlaceholder": "sk-...",
|
||||
"settings.providers.page.auth.oauthMethodFallback": "Método OAuth {index}",
|
||||
"settings.providers.page.auth.pasteAuthorizationCodePlaceholder": "Colar código de autorização",
|
||||
"settings.providers.page.auth.oauth.starting": "Iniciando a autorização…",
|
||||
"settings.providers.page.auth.oauth.waiting": "Aguardando a autorização…",
|
||||
"settings.providers.page.auth.oauth.waitingHint": "Conclua o login no navegador. Mantenha esta página aberta — a conexão será concluída sozinha.",
|
||||
"settings.providers.page.auth.oauth.codeHint": "Copie o código de autorização do navegador e cole aqui.",
|
||||
"settings.providers.page.auth.oauth.deviceCodeLabel": "Código do dispositivo",
|
||||
"settings.providers.page.auth.oauth.linkLabel": "Link de autorização",
|
||||
"settings.providers.page.auth.oauth.promptRequired": "Preencha “{field}” para continuar",
|
||||
"settings.providers.page.auth.oauth.error.sessionExpired": "A solicitação de autorização expirou. Conecte novamente para reiniciá-la.",
|
||||
"settings.providers.page.auth.oauth.error.codeRequired": "Este provedor precisa do código de autorização do seu navegador.",
|
||||
"settings.providers.page.auth.oauth.error.declined": "A autorização foi recusada ou não foi concluída.",
|
||||
"settings.providers.page.auth.oauth.error.invalidInput": "Os dados informados foram recusados.",
|
||||
"settings.providers.page.auth.connected": "Conectado",
|
||||
"settings.providers.page.auth.incomplete": "Credenciais ausentes",
|
||||
"settings.providers.page.auth.incompleteHint": "· Adicione uma chave de API ou {env:VAR} antes de usar este provedor no chat",
|
||||
@@ -1391,6 +1402,9 @@ export const settingsDict = {
|
||||
"settings.providers.page.actions.open": "Abrir",
|
||||
"settings.providers.page.actions.copy": "Copiar",
|
||||
"settings.providers.page.actions.complete": "Completar",
|
||||
"settings.providers.page.actions.continue": "Continuar",
|
||||
"settings.providers.page.actions.cancel": "Cancelar",
|
||||
"settings.providers.page.actions.tryAgain": "Tentar novamente",
|
||||
"settings.providers.page.actions.hide": "Ocultar",
|
||||
"settings.providers.page.actions.reconnect": "Reconectar",
|
||||
"settings.providers.page.actions.edit": "Editar",
|
||||
@@ -1406,7 +1420,6 @@ export const settingsDict = {
|
||||
"settings.providers.page.toast.apiKeySaved": "Chave API salva",
|
||||
"settings.providers.page.toast.oauthStartFailed": "Não foi possível iniciar o fluxo OAuth",
|
||||
"settings.providers.page.toast.oauthDetailsMissing": "Não se devolvieron detalhes de OAuth",
|
||||
"settings.providers.page.toast.completeOAuthInBrowser": "Complete o fluxo OAuth no navegador",
|
||||
"settings.providers.page.toast.oauthCompleteFailed": "Não foi possível concluir o fluxo OAuth",
|
||||
"settings.providers.page.toast.oauthCompleted": "Conexão OAuth concluída",
|
||||
"settings.providers.page.toast.oauthLinkCopied": "Link de OAuth copiado",
|
||||
|
||||
Reference in New Issue
Block a user