Skip to content

Commit 2b28db7

Browse files
authored
🐛 Fix welcome page to show logged-in user (fastapi#1218)
1 parent 6dbab0b commit 2b28db7

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

frontend/src/routes/_layout/index.tsx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
11
import { Box, Container, Text } from "@chakra-ui/react"
2-
import { useQueryClient } from "@tanstack/react-query"
32
import { createFileRoute } from "@tanstack/react-router"
43

5-
import type { UserPublic } from "../../client"
4+
import useAuth from "../../hooks/useAuth"
65

76
export const Route = createFileRoute("/_layout/")({
87
component: Dashboard,
98
})
109

1110
function Dashboard() {
12-
const queryClient = useQueryClient()
13-
14-
const currentUser = queryClient.getQueryData<UserPublic>(["currentUser"])
11+
const { user: currentUser } = useAuth()
1512

1613
return (
1714
<>

0 commit comments

Comments
 (0)