Skip to content

Commit

Permalink
Handle case when admin's JWT gets refreshed
Browse files Browse the repository at this point in the history
  • Loading branch information
ericpgreen2 committed Sep 13, 2023
1 parent a4e72ae commit 302d95b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion web-admin/src/routes/[organization]/[project]/+layout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import { page } from "$app/stores";
import RuntimeProvider from "@rilldata/web-common/runtime-client/RuntimeProvider.svelte";
import { useProjectRuntime } from "../../../components/projects/selectors";
import { viewAsUserStore } from "../../../features/view-as-user/viewAsUserStore";
$: projRuntime = useProjectRuntime(
$page.params.organization,
Expand All @@ -17,7 +18,9 @@
}
</script>

{#if $projRuntime.data}
<!-- Note: we don't provide the runtime here when the user is being spoofed via the "View As" functionality.
In these cases, the "View as" actions manually set the runtime. -->
{#if $projRuntime.data && !$viewAsUserStore}
<RuntimeProvider
host={$projRuntime.data.host}
instanceId={$projRuntime.data.instanceId}
Expand Down

0 comments on commit 302d95b

Please sign in to comment.