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:
@@ -1321,6 +1321,17 @@ export const settingsDict = {
|
||||
'settings.providers.page.auth.apiKeyPlaceholder': 'sk-...',
|
||||
'settings.providers.page.auth.oauthMethodFallback': 'OAuth-Methode {index}',
|
||||
'settings.providers.page.auth.pasteAuthorizationCodePlaceholder': 'Autorisierungscode einfügen',
|
||||
'settings.providers.page.auth.oauth.starting': 'Autorisierung wird gestartet …',
|
||||
'settings.providers.page.auth.oauth.waiting': 'Warten auf Autorisierung …',
|
||||
'settings.providers.page.auth.oauth.waitingHint': 'Schließen Sie die Anmeldung im Browser ab. Lassen Sie diese Seite geöffnet – die Verbindung wird von selbst hergestellt.',
|
||||
'settings.providers.page.auth.oauth.codeHint': 'Kopieren Sie den Autorisierungscode aus dem Browser und fügen Sie ihn hier ein.',
|
||||
'settings.providers.page.auth.oauth.deviceCodeLabel': 'Gerätecode',
|
||||
'settings.providers.page.auth.oauth.linkLabel': 'Autorisierungslink',
|
||||
'settings.providers.page.auth.oauth.promptRequired': 'Füllen Sie „{field}“ aus, um fortzufahren',
|
||||
'settings.providers.page.auth.oauth.error.sessionExpired': 'Die Autorisierungsanfrage ist abgelaufen. Verbinden Sie erneut, um sie neu zu starten.',
|
||||
'settings.providers.page.auth.oauth.error.codeRequired': 'Dieser Anbieter benötigt den Autorisierungscode aus Ihrem Browser.',
|
||||
'settings.providers.page.auth.oauth.error.declined': 'Die Autorisierung wurde abgelehnt oder nicht abgeschlossen.',
|
||||
'settings.providers.page.auth.oauth.error.invalidInput': 'Die eingegebenen Angaben wurden abgelehnt.',
|
||||
'settings.providers.page.auth.connected': 'Verbunden',
|
||||
'settings.providers.page.auth.incomplete': 'Anmeldedaten fehlen',
|
||||
'settings.providers.page.auth.incompleteHint': '· Fügen Sie einen API-Schlüssel oder {env:VAR} hinzu, bevor Sie diesen Anbieter im Chat verwenden',
|
||||
@@ -1351,6 +1362,9 @@ export const settingsDict = {
|
||||
'settings.providers.page.actions.open': 'Öffnen',
|
||||
'settings.providers.page.actions.copy': 'Kopieren',
|
||||
'settings.providers.page.actions.complete': 'Vervollständigen',
|
||||
'settings.providers.page.actions.continue': 'Weiter',
|
||||
'settings.providers.page.actions.cancel': 'Abbrechen',
|
||||
'settings.providers.page.actions.tryAgain': 'Wiederholen',
|
||||
'settings.providers.page.actions.hide': 'Ausblenden',
|
||||
'settings.providers.page.actions.reconnect': 'Erneut verbinden',
|
||||
'settings.providers.page.actions.edit': 'Bearbeiten',
|
||||
@@ -1365,7 +1379,6 @@ export const settingsDict = {
|
||||
'settings.providers.page.toast.apiKeySaved': 'API-Schlüssel gespeichert',
|
||||
'settings.providers.page.toast.oauthStartFailed': 'Fehler beim Starten des OAuth-Flows',
|
||||
'settings.providers.page.toast.oauthDetailsMissing': 'Keine OAuth-Details zurückgegeben',
|
||||
'settings.providers.page.toast.completeOAuthInBrowser': 'Schließen Sie den OAuth-Flow in Ihrem Browser ab',
|
||||
'settings.providers.page.toast.oauthCompleteFailed': 'Fehler beim Abschließen des OAuth-Flows',
|
||||
'settings.providers.page.toast.oauthCompleted': 'OAuth-Verbindung abgeschlossen',
|
||||
'settings.providers.page.toast.oauthLinkCopied': 'OAuth-Link kopiert',
|
||||
|
||||
Reference in New Issue
Block a user