Add login route handling in AppRouter and introduce SessionRouter for session management
This commit is contained in:
@@ -332,6 +332,13 @@ function App() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function AppRouter() {
|
function AppRouter() {
|
||||||
|
if (window.location.pathname === '/login') {
|
||||||
|
return <RouterProvider router={router} context={{ session: null }} />
|
||||||
|
}
|
||||||
|
return <SessionRouter />
|
||||||
|
}
|
||||||
|
|
||||||
|
function SessionRouter() {
|
||||||
const session = useQuery({
|
const session = useQuery({
|
||||||
queryKey: ['session'],
|
queryKey: ['session'],
|
||||||
queryFn: api.session,
|
queryFn: api.session,
|
||||||
|
|||||||
Reference in New Issue
Block a user