some change
This commit is contained in:
parent
d4a1492d56
commit
313f1def49
38 changed files with 475 additions and 401 deletions
13
src/app/auth/components/Protected.tsx
Normal file
13
src/app/auth/components/Protected.tsx
Normal file
|
@ -0,0 +1,13 @@
|
|||
import { useUser } from '../../user/userStore.ts'
|
||||
import { useNavigate, Outlet } from 'react-router-dom'
|
||||
|
||||
export default function Protected() {
|
||||
const [user] = useUser()
|
||||
|
||||
const navigate = useNavigate()
|
||||
if (!user) {
|
||||
navigate('/login')
|
||||
}
|
||||
|
||||
return <Outlet />
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue