UBERF-5734: Fix guest mode display of server generated links (#4790)

Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
Andrey Sobolev 2024-02-27 22:42:17 +07:00 committed by GitHub
parent 336732948d
commit 604e37576a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 10 additions and 6 deletions

View File

@ -265,8 +265,8 @@
{#await load() then res}
{#if res}
<div class="workbench-container" style:flex-direction={'row'}>
<div class="workbench-container inner">
<div class="workbench-container h-full" style:flex-direction={'row'}>
<div class="workbench-container inner h-full">
<div class="antiPanel-component antiComponent" bind:this={contentPanel}>
{#if currentApplication && currentApplication.component}
<Component is={currentApplication.component} props={{ currentSpace, visibleNav: false }} />

View File

@ -54,14 +54,18 @@ export async function OnPublicLinkCreate (tx: Tx, control: TriggerControl): Prom
return res
}
function generateUrl (linkId: Ref<PublicLink>, 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<PublicLink>, 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,