From 8456c5e8527091472d2f52da71ef280bb21f66c4 Mon Sep 17 00:00:00 2001 From: Aravind Date: Sat, 19 Sep 2026 23:22:45 +0530 Subject: [PATCH] login timeout issue fix --- src/app/layout.tsx | 11 +++ .../auth/providers/SessionProvider.tsx | 22 +++++ src/features/auth/services/tabSession.ts | 84 +++++++++++++++++++ 3 files changed, 117 insertions(+) create mode 100644 src/features/auth/services/tabSession.ts diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 7dc90cc..a35b3fc 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -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 > + {/* + FIRST child of , 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. + */} +