Add shared device inactivity timeout to AuthGate
This commit is contained in:
parent
df3aec7bc5
commit
da6d50ff95
1 changed files with 7 additions and 0 deletions
|
|
@ -1,6 +1,13 @@
|
||||||
import { useEffect, useState, createContext, useContext } from 'react'
|
import { useEffect, useState, createContext, useContext } 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