mirror of
https://github.com/different-ai/openwork
synced 2026-04-25 17:15:34 +02:00
fix desktop runtime owner token refresh
This commit is contained in:
@@ -832,7 +832,12 @@ export function createRuntimeManager({ app, desktopRoot, listLocalWorkspacePaths
|
|||||||
openworkServerState.lanUrl = connectUrls.lanUrl;
|
openworkServerState.lanUrl = connectUrls.lanUrl;
|
||||||
|
|
||||||
await waitForHttpOk(`${baseUrl}/health`, 10_000);
|
await waitForHttpOk(`${baseUrl}/health`, 10_000);
|
||||||
const ownerToken = tokens.ownerToken || (await issueOwnerToken(baseUrl, tokens.hostToken));
|
// Owner tokens live in the OpenWork server token store, which can be reset
|
||||||
|
// independently from the desktop runtime token cache. Always mint a fresh
|
||||||
|
// owner token for the newly-started server instead of trusting the cached
|
||||||
|
// value; otherwise the renderer can receive a stale bearer token and all
|
||||||
|
// workspace calls fail with 401.
|
||||||
|
const ownerToken = await issueOwnerToken(baseUrl, tokens.hostToken);
|
||||||
openworkServerState.ownerToken = ownerToken;
|
openworkServerState.ownerToken = ownerToken;
|
||||||
if (ownerToken) {
|
if (ownerToken) {
|
||||||
await persistWorkspaceOwnerToken(activeWorkspace, ownerToken);
|
await persistWorkspaceOwnerToken(activeWorkspace, ownerToken);
|
||||||
|
|||||||
Reference in New Issue
Block a user