login timeout issue fix
This commit is contained in:
@@ -3,6 +3,7 @@ import {cookies} from 'next/headers';
|
||||
import {Sora, Inter} from 'next/font/google';
|
||||
import './globals.css';
|
||||
import {getServerSession} from '@/features/auth/services/serverSession';
|
||||
import {tabSessionScript} from '@/features/auth/services/tabSession';
|
||||
import {
|
||||
htmlThemeAttr,
|
||||
parseThemeMode,
|
||||
@@ -105,6 +106,16 @@ export default async function RootLayout({
|
||||
suppressHydrationWarning
|
||||
>
|
||||
<body>
|
||||
{/*
|
||||
FIRST child of <body>, and that position is the whole point: it runs
|
||||
before the markup below it is parsed, so a tab that inherited the
|
||||
cookies without owning the session never paints the workspace. An
|
||||
effect inside Providers would run after the first paint instead.
|
||||
See services/tabSession.ts for what it does and why it fails open.
|
||||
*/}
|
||||
<script
|
||||
dangerouslySetInnerHTML={{__html: tabSessionScript(session !== null)}}
|
||||
/>
|
||||
<Providers initialSession={session} initialThemeMode={themeMode}>
|
||||
{children}
|
||||
</Providers>
|
||||
|
||||
Reference in New Issue
Block a user