1
0
Fork 0
mirror of https://github.com/immich-app/immich.git synced 2025-04-09 09:36:24 +02:00
immich/web/src/routes/(user)/photos/+page.server.ts
Michel Heusschen 807bdfeda9
fix(web): layout nesting ()
Co-authored-by: Alex Tran <alex.tran1502@gmail.com>
2023-02-26 21:23:43 -06:00

21 lines
421 B
TypeScript

import type { PageServerLoad } from './$types';
import { redirect, error } from '@sveltejs/kit';
export const load: PageServerLoad = async ({ parent }) => {
try {
const { user } = await parent();
if (!user) {
throw error(400, 'Not logged in');
}
return {
user,
meta: {
title: 'Photos'
}
};
} catch (e) {
console.log('Photo page load error', e);
throw redirect(302, '/auth/login');
}
};