mirror of https://github.com/buster-so/buster.git
Add some logs in
This commit is contained in:
parent
44f9ae493b
commit
7d5d0e1c0a
|
@ -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' });
|
||||
|
|
|
@ -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' });
|
||||
},
|
||||
});
|
||||
|
|
|
@ -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' });
|
||||
},
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue