Desktop OIDC: non-blocking fetch + poll, don't leave webview
Some checks failed
ci / build-test (push) Has been cancelled
ci / docker-build (push) Has been cancelled
Desktop App / Build Linux (amd64) (push) Has been cancelled
Desktop App / Attach to Release (push) Has been cancelled

SPA fetches /oidc/open (returns session ID immediately), then polls
/oidc/result every 500ms. Go server opens browser in a goroutine.
Webview never leaves the Wails origin. Token is saved to keychain and
returned through the poll response.
This commit is contained in:
2026-07-14 00:09:46 +02:00
parent c8ef3793d7
commit 8b3fe02a10
4 changed files with 99 additions and 62 deletions

View File

@@ -102,9 +102,8 @@ export async function startLogin(): Promise<void> {
})
if (isDesktop) {
const apiUrl = getConfig().apiUrl || location.protocol + '//' + location.host
location.href = `http://127.0.0.1:18901/oidc/open?apiUrl=${encodeURIComponent(apiUrl)}`
throw new Error('Redirecting to login...')
const apiUrl = getConfig().apiUrl || ''
throw new Error('DESKTOP_OIDC:' + apiUrl)
}
location.href = `${cfg.authorization_endpoint.replace(/\/$/, '')}/?${params}`