diff --git a/plugins/guest-resources/src/components/Guest.svelte b/plugins/guest-resources/src/components/Guest.svelte index 319252b9c1..da11d660b7 100644 --- a/plugins/guest-resources/src/components/Guest.svelte +++ b/plugins/guest-resources/src/components/Guest.svelte @@ -265,8 +265,8 @@ {#await load() then res} {#if res} -
-
+
+
{#if currentApplication && currentApplication.component} diff --git a/server-plugins/guest-resources/src/index.ts b/server-plugins/guest-resources/src/index.ts index f056271236..c2a96875b6 100644 --- a/server-plugins/guest-resources/src/index.ts +++ b/server-plugins/guest-resources/src/index.ts @@ -54,14 +54,18 @@ export async function OnPublicLinkCreate (tx: Tx, control: TriggerControl): Prom return res } -function generateUrl (linkId: Ref, workspace: WorkspaceId): string { +export function getPublicLinkUrl (workspace: WorkspaceId): string { const front = getMetadata(serverCore.metadata.FrontUrl) ?? '' - const token = generateToken(guestAccountEmail, workspace, { linkId, guest: 'true' }) - const path = `${guestId}/${workspace.name}?token=${token}` + const path = `${guestId}/${workspace.name}` return concatLink(front, path) } -export async function GetPublicLink ( +function generateUrl (linkId: Ref, workspace: WorkspaceId): string { + const token = generateToken(guestAccountEmail, workspace, { linkId, guest: 'true' }) + return `${getPublicLinkUrl(workspace)}?token=${token}` +} + +export async function getPublicLink ( doc: Doc, client: TxOperations, workspace: WorkspaceId,