admin login issue for timeout issue

This commit is contained in:
2026-09-22 00:23:34 +05:30
parent b60b8baef6
commit 91e4db8217
13 changed files with 343 additions and 141 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 {resolveTabId} from '@/features/auth/services/tabScopeRequest';
import {tabSessionScript} from '@/features/auth/services/tabSession';
import {
htmlThemeAttr,
@@ -88,6 +89,22 @@ export default async function RootLayout({
* already answered in this very request.
*/
const session = await getServerSession();
/**
* WHICH tab that session was resolved from, handed to the client alongside it.
*
* A document navigation carries no `X-Tab-Id`, so `getServerSession` resolves
* through the `loyaly_tab` pointer — the tab that was last FOCUSED, which for
* a newly opened tab is somebody else. The seed is still worth sending (it is
* what saves a guard spinner on every load), but the client has to be able to
* tell whether the seed is its own. Without this it could not: it received an
* identity with nothing attached saying who it belonged to, so a second tab
* rendered the first tab's user in the shell and only found out when a data
* call answered 401.
*
* Not a credential and not a decision — just the label that lets the client
* recognise a seed that is not about it. See SessionProvider.
*/
const tabId = await resolveTabId();
const themeMode = await readThemeMode();
return (
@@ -117,7 +134,11 @@ export default async function RootLayout({
services/tabSession.ts for what it replaced and why.
*/}
<script dangerouslySetInnerHTML={{__html: tabSessionScript()}} />
<Providers initialSession={session} initialThemeMode={themeMode}>
<Providers
initialSession={session}
initialTabId={tabId}
initialThemeMode={themeMode}
>
{children}
</Providers>
</body>