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() {
|
||||
if (window.location.pathname === '/login') {
|
||||
return <RouterProvider router={router} context={{ session: null }} />
|
||||
}
|
||||
return <SessionRouter />
|
||||
}
|
||||
|
||||
function SessionRouter() {
|
||||
const session = useQuery({
|
||||
queryKey: ['session'],
|
||||
queryFn: api.session,
|
||||
|
||||
Reference in New Issue
Block a user