mirror of
https://github.com/immich-app/immich.git
synced 2025-04-09 09:36:24 +02:00
21 lines
421 B
TypeScript
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');
|
|
}
|
|
};
|