use user from session

This commit is contained in:
john 2025-05-20 10:06:18 +02:00
parent 5f47162a50
commit 700eaf3eb2
16 changed files with 148 additions and 107 deletions

View file

@ -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')
}