use user from session
This commit is contained in:
parent
5f47162a50
commit
700eaf3eb2
16 changed files with 148 additions and 107 deletions
|
@ -1,7 +1,7 @@
|
|||
import { useNavigate } from 'react-router-dom'
|
||||
import { AuthService } from '../authService.ts'
|
||||
import { useEffect } from 'react'
|
||||
import { useUser } from '../../user/userStore.ts'
|
||||
import { useUser } from '../../user/user.ts'
|
||||
|
||||
interface LogoutPageProps {
|
||||
authService: AuthService
|
||||
|
@ -9,9 +9,10 @@ interface LogoutPageProps {
|
|||
|
||||
export default function LogoutPage({ authService }: LogoutPageProps) {
|
||||
const navigate = useNavigate()
|
||||
const { user } = useUser()
|
||||
const user = useUser()
|
||||
|
||||
useEffect(() => {
|
||||
console.debug(user)
|
||||
if (!user) {
|
||||
navigate('/login')
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue