Files
immich/web/src/routes/auth/login/+page.ts
T
Min Idzelis b2dd5a3152 feat: loading screen, initSDK on bootstrap, fix FOUC for theme (#10350)
* feat: loading screen, initSDK on bootstrap, fix FOUC for theme

* pulsate immich logo, don't set localstorage

* Make it spin

* Rework error handling a bit

* Cleanup

* fix test

* rename, memoize

---------

Co-authored-by: Alex Tran <alex.tran1502@gmail.com>
2024-08-25 17:34:08 -05:00

25 lines
607 B
TypeScript

import { AppRoute } from '$lib/constants';
import { serverConfig } from '$lib/stores/server-config.store';
import { getFormatter } from '$lib/utils/i18n';
import { redirect } from '@sveltejs/kit';
import { get } from 'svelte/store';
import type { PageLoad } from './$types';
export const load = (async ({ parent }) => {
await parent();
const { isInitialized } = get(serverConfig);
if (!isInitialized) {
// Admin not registered
redirect(302, AppRoute.AUTH_REGISTER);
}
const $t = await getFormatter();
return {
meta: {
title: $t('login'),
},
};
}) satisfies PageLoad;