immich/web/src/routes/+layout.server.ts

13 lines
337 B
TypeScript
Raw Normal View History

import type { LayoutServerLoad } from './$types';
export const load = (async ({ locals: { api } }) => {
try {
const { data: user } = await api.userApi.getMyUserInfo();
return { user };
} catch (e) {
console.error('[ERROR] layout.server.ts [LayoutServerLoad]: ');
return { user: undefined };
}
}) satisfies LayoutServerLoad;