login timeout issue fix

This commit is contained in:
2026-09-19 23:22:45 +05:30
parent 02aadaf091
commit 8456c5e852
3 changed files with 117 additions and 0 deletions

View File

@@ -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>