From b280d391e86eac4051e688e52199cd5ee2c4ec14 Mon Sep 17 00:00:00 2001 From: jtricerolph Date: Mon, 13 Jul 2026 11:53:06 +0000 Subject: [PATCH] Add shared device inactivity timeout to AuthGate --- src/components/AuthGate.tsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/components/AuthGate.tsx b/src/components/AuthGate.tsx index a5b5a2b..348679f 100644 --- a/src/components/AuthGate.tsx +++ b/src/components/AuthGate.tsx @@ -1,7 +1,14 @@ -import { useEffect, useState } from 'react' +import { useEffect, useRef, useState } from 'react' import { useNavigate, useLocation } from 'react-router-dom' import type { User } from '../types' +const SHARED_TIMEOUT_MS = 10 * 60 * 1000 + +function isSharedDevice() { + return document.cookie.split(';').some(c => c.trim() === 'hnf_shared_device=1') +} + + interface Props { children: (user: User) => React.ReactNode } export function AuthGate({ children }: Props) {