Skip to content

Commit f804cbd

Browse files
committed
fix: logged out user not able to view a public canvas dashboard (#8547)
1 parent 5951f4f commit f804cbd

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

web-admin/src/features/bookmarks/selectors.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export function getBookmarksQueryOptions(
5353
},
5454
{
5555
query: {
56-
enabled: hasUser && !!projectId,
56+
enabled: Boolean(hasUser && !!projectId),
5757
},
5858
},
5959
);

web-admin/src/features/navigation/TopNavigationBar.svelte

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@
181181
});
182182
$: exploreSpec = $exploreQuery.data?.explore?.explore?.state?.validSpec;
183183
$: isDashboardValid = !!exploreSpec;
184+
$: hasUserAccess = $user.isSuccess && $user.data.user && !onPublicURLPage;
184185
185186
$: publicURLDashboardTitle =
186187
$exploreQuery.data?.explore?.explore?.state?.validSpec?.displayName ||
@@ -242,7 +243,7 @@
242243
{#if $dashboardChat}
243244
<ChatToggle />
244245
{/if}
245-
{#if $user.isSuccess && $user.data.user && !onPublicURLPage}
246+
{#if hasUserAccess}
246247
<ExploreBookmarks
247248
{organization}
248249
{project}
@@ -259,7 +260,7 @@
259260
{/if}
260261
{/if}
261262

262-
{#if onCanvasDashboardPage}
263+
{#if onCanvasDashboardPage && hasUserAccess}
263264
<CanvasBookmarks {organization} {project} canvasName={dashboard} />
264265
<ShareDashboardPopover createMagicAuthTokens={false} />
265266
{/if}

0 commit comments

Comments
 (0)