Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion apps/desktop/src/renderer/routes/_authenticated/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export const Route = createFileRoute("/_authenticated")({
});

function AuthenticatedLayout() {
const { data: session } = authClient.useSession();
const { data: session, isPending } = authClient.useSession();
const isSignedIn = env.SKIP_ENV_VALIDATION || !!session?.user;
const activeOrganizationId = env.SKIP_ENV_VALIDATION
? MOCK_ORG_ID
Expand Down Expand Up @@ -66,6 +66,10 @@ function AuthenticatedLayout() {
},
});

if (isPending) {
return null;
}

if (!isSignedIn) {
return <Navigate to="/sign-in" replace />;
}
Expand Down
Loading