mirror of
https://github.com/samsonjs/immich.git
synced 2026-04-22 13:55:53 +00:00
* fix: don't reveal user count publicly * fix: mobile and user controller * fix: update other frontend endpoints * fix: revert openapi change * chore: open api * fix: initialize * openapi --------- Co-authored-by: Alex Tran <alex.tran1502@gmail.com>
26 lines
695 B
TypeScript
26 lines
695 B
TypeScript
export const prerender = false;
|
|
|
|
import { AppRoute } from '$lib/constants';
|
|
import { redirect } from '@sveltejs/kit';
|
|
import type { PageServerLoad } from './$types';
|
|
|
|
export const load = (async ({ parent, locals: { api } }) => {
|
|
const { user } = await parent();
|
|
if (user) {
|
|
throw redirect(302, AppRoute.PHOTOS);
|
|
}
|
|
|
|
const { data } = await api.serverInfoApi.getServerConfig();
|
|
|
|
if (data.isInitialized) {
|
|
// Redirect to login page if there exists an admin account (i.e. server is initialized)
|
|
throw redirect(302, AppRoute.AUTH_LOGIN);
|
|
}
|
|
|
|
return {
|
|
meta: {
|
|
title: 'Welcome 🎉',
|
|
description: 'Immich Web Interface',
|
|
},
|
|
};
|
|
}) satisfies PageServerLoad;
|