Skip to content

High performance self-hosted photo and video management solution.

412 B
Raw Blame
import { authenticate } from '#lib/utils/auth.ts';
import { getAssetInfoFromParam, isSharedLinkRoute } from '#lib/utils/navigation.ts';
import type { LayoutLoad } from './$types';

export const load = (async ({ url, params, route }) => {
  await authenticate(url, { public: isSharedLinkRoute(route.id) });
  const asset = await getAssetInfoFromParam(params);

  return {
    asset,
  };
}) satisfies LayoutLoad;