File tree Expand file tree Collapse file tree
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 (
Original file line number Diff line number Diff line change @@ -861,9 +861,7 @@ export const auth = betterAuth({
861861 } ) ,
862862 ]
863863 : [ ] ) ,
864- admin ( {
865- impersonationSessionDuration : 60 * 60 * 24 * 365 * 100 ,
866- } ) ,
864+ admin ( ) ,
867865 jwt ( {
868866 jwks : {
869867 keyPairConfig : { alg : 'RS256' } ,
You can’t perform that action at this time.
0 commit comments