Desktop OIDC: full page nav to localhost, meta redirect back
SPA navigates to 127.0.0.1:18901/oidc/start, passing ret URL. Go opens browser, waits for callback, saves token, returns HTML with <meta refresh> back to Wails app with ?desktop=1&token=TOKEN. main.ts extracts token from URL on reload.
This commit is contained in:
@@ -103,7 +103,9 @@ export async function startLogin(): Promise<void> {
|
||||
|
||||
if (isDesktop) {
|
||||
const apiUrl = getConfig().apiUrl || ''
|
||||
throw new Error('DESKTOP_OIDC:' + apiUrl)
|
||||
const ret = encodeURIComponent(location.origin + location.pathname.replace(/\/$/, '') + '?desktop=1')
|
||||
location.href = `http://127.0.0.1:18901/oidc/start?apiUrl=${encodeURIComponent(apiUrl)}&ret=${ret}`
|
||||
return
|
||||
}
|
||||
|
||||
location.href = `${cfg.authorization_endpoint.replace(/\/$/, '')}/?${params}`
|
||||
|
||||
Reference in New Issue
Block a user