Add shared device inactivity timeout to AuthGate

This commit is contained in:
jtricerolph 2026-07-13 11:53:06 +00:00
parent 9a7d7dd5b4
commit b280d391e8

View file

@ -1,7 +1,14 @@
import { useEffect, useState } from 'react' import { useEffect, useRef, useState } from 'react'
import { useNavigate, useLocation } from 'react-router-dom' import { useNavigate, useLocation } from 'react-router-dom'
import type { User } from '../types' 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 } interface Props { children: (user: User) => React.ReactNode }
export function AuthGate({ children }: Props) { export function AuthGate({ children }: Props) {