This commit is contained in:
john 2025-05-06 18:13:12 +02:00
parent 4573048a47
commit d4a1492d56
16 changed files with 463 additions and 98 deletions

22
src/auth/LogoutPage.tsx Normal file
View file

@ -0,0 +1,22 @@
import { useNavigate } from 'react-router'
import { AuthService } from './authService.ts'
import { useEffect } from 'react'
interface LogoutPageProps {
authService: AuthService
}
export default function LogoutPage({ authService }: LogoutPageProps) {
const navigate = useNavigate()
useEffect(() => {
const timeout = setTimeout(async () => {
await authService.logout()
navigate('/')
})
return () => clearTimeout(timeout)
}, [authService, navigate])
return <></>
}