test auth fix idk
This commit is contained in:
@@ -122,26 +122,12 @@ export const Route = createRootRouteWithContext<{
|
||||
context.queryClient,
|
||||
playerQueries.auth()
|
||||
);
|
||||
|
||||
console.log('__root beforeLoad auth data:', auth);
|
||||
|
||||
return { auth };
|
||||
} catch (error: any) {
|
||||
if (typeof window !== 'undefined') {
|
||||
const { doesSessionExist } = await import('supertokens-web-js/recipe/session');
|
||||
const { refreshManager } = await import('@/lib/supertokens/refresh-manager');
|
||||
|
||||
const sessionExists = await doesSessionExist();
|
||||
if (sessionExists) {
|
||||
try {
|
||||
await refreshManager.refresh();
|
||||
const auth = await ensureServerQueryData(
|
||||
context.queryClient,
|
||||
playerQueries.auth()
|
||||
);
|
||||
return { auth };
|
||||
} catch {
|
||||
return {};
|
||||
}
|
||||
}
|
||||
}
|
||||
console.error('__root beforeLoad error:', error);
|
||||
return {};
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user