mirror of
https://github.com/immich-app/immich.git
synced 2025-12-10 23:48:10 -05:00
* refactoring * refactor * fix naming * Added animation * add user setting page * Add skeleton for user setting page * styling * styling * Spelling
15 lines
326 B
TypeScript
15 lines
326 B
TypeScript
import { redirect } from '@sveltejs/kit';
|
|
import type { PageServerLoad } from './$types';
|
|
|
|
export const load: PageServerLoad = async ({ parent }) => {
|
|
const { user } = await parent();
|
|
|
|
if (!user) {
|
|
throw redirect(302, '/auth/login');
|
|
} else if (!user.isAdmin) {
|
|
throw redirect(302, '/photos');
|
|
}
|
|
|
|
return { user };
|
|
};
|