Add shared device inactivity timeout to AuthGate
This commit is contained in:
parent
dde41bc5d1
commit
e4152b183b
1 changed files with 7 additions and 0 deletions
|
|
@ -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)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue