Add some logs in

This commit is contained in:
Nate Kelley 2025-09-10 11:03:19 -06:00
parent 44f9ae493b
commit 7d5d0e1c0a
No known key found for this signature in database
GPG Key ID: FD90372AB8D98B4F
3 changed files with 5 additions and 0 deletions

View File

@ -15,6 +15,7 @@ export const Route = createFileRoute('/app')({
context: ({ context }) => ({ ...context, getAppLayout }),
ssr: true,
beforeLoad: async () => {
console.log('before load app');
const { isExpired, accessToken = '' } = await getSupabaseSession();
if (isExpired || !accessToken) {
@ -29,6 +30,7 @@ export const Route = createFileRoute('/app')({
loader: async ({ context }) => {
const { queryClient, accessToken } = context;
try {
console.log('loader app');
const [initialLayout, user] = await Promise.all([
getAppLayout({ id: PRIMARY_APP_LAYOUT_ID }),
getSupabaseUser(),
@ -37,6 +39,7 @@ export const Route = createFileRoute('/app')({
prefetchListDatasources(queryClient),
prefetchGetDatasets(queryClient),
]);
console.log('loader app done', user, initialLayout);
if (!user) {
throw redirect({ to: '/auth/login' });

View File

@ -2,6 +2,7 @@ import { createFileRoute, redirect } from '@tanstack/react-router';
export const Route = createFileRoute('/app/')({
beforeLoad: async () => {
console.log('before load redirecting to app home');
throw redirect({ to: '/app/home' });
},
});

View File

@ -2,6 +2,7 @@ import { createFileRoute, redirect } from '@tanstack/react-router';
export const Route = createFileRoute('/')({
beforeLoad: async () => {
console.log('before load redirecting to app');
throw redirect({ to: '/app/home' });
},
});