File tree Expand file tree Collapse file tree
apps/sim/app/workspace/[workspaceId] Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ import { redirect } from 'next/navigation'
12import { ToastProvider } from '@/components/emcn'
23import { getSession } from '@/lib/auth'
34import { NavTour } from '@/app/workspace/[workspaceId]/components/product-tour'
@@ -13,8 +14,11 @@ import { getOrgWhitelabelSettings } from '@/ee/whitelabeling/org-branding'
1314
1415export default async function WorkspaceLayout ( { children } : { children : React . ReactNode } ) {
1516 const session = await getSession ( )
17+ if ( ! session ?. user ) {
18+ redirect ( '/login' )
19+ }
1620 // The organization plugin is conditionally spread so TS can't infer activeOrganizationId on the base session type.
17- const orgId = ( session ? .session as { activeOrganizationId ?: string } | null ) ?. activeOrganizationId
21+ const orgId = ( session . session as { activeOrganizationId ?: string } | null ) ?. activeOrganizationId
1822 const initialOrgSettings = orgId ? await getOrgWhitelabelSettings ( orgId ) : null
1923
2024 return (
You can’t perform that action at this time.
0 commit comments