Add shared device inactivity timeout to AuthGate

This commit is contained in:
jtricerolph 2026-07-13 11:53:06 +00:00
parent 516f774223
commit 071ea9bfc3

View file

@ -2,6 +2,13 @@ import { createContext, useContext, useEffect, useState } from 'react'
import type { ReactNode } from 'react' import type { ReactNode } from 'react'
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 AuthCtx { user: User } interface AuthCtx { user: User }
const Ctx = createContext<AuthCtx | null>(null) const Ctx = createContext<AuthCtx | null>(null)