Pass apiUrl through OIDC redirect so SPA has it on return
The apiUrl configured on the Config page was lost when the webview navigated away to localhost and back. Now it's included in the return URL as ?desktop=1&apiUrl=...&token=...
This commit is contained in:
@@ -103,7 +103,10 @@ export async function startLogin(): Promise<void> {
|
||||
|
||||
if (isDesktop) {
|
||||
const apiUrl = getConfig().apiUrl || ''
|
||||
const ret = encodeURIComponent(location.origin + location.pathname.replace(/\/$/, '') + '?desktop=1')
|
||||
const ret = encodeURIComponent(
|
||||
location.origin + location.pathname.replace(/\/$/, '') +
|
||||
'?desktop=1&apiUrl=' + encodeURIComponent(apiUrl)
|
||||
)
|
||||
location.href = `http://127.0.0.1:18901/oidc/start?apiUrl=${encodeURIComponent(apiUrl)}&ret=${ret}`
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user