some change
This commit is contained in:
parent
d4a1492d56
commit
313f1def49
38 changed files with 475 additions and 401 deletions
22
src/app/auth/pages/LogoutPage.tsx
Normal file
22
src/app/auth/pages/LogoutPage.tsx
Normal file
|
@ -0,0 +1,22 @@
|
|||
import { useNavigate } from 'react-router-dom'
|
||||
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 () => {
|
||||
navigate('/login')
|
||||
await authService.logout()
|
||||
})
|
||||
|
||||
return () => clearTimeout(timeout)
|
||||
}, [authService, navigate])
|
||||
|
||||
return <></>
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue