Files
immich/web/src/routes/auth/change-password/+page.ts
T
2025-05-15 14:45:23 -04:00

23 lines
588 B
TypeScript

import { AppRoute } from '$lib/constants';
import { user } from '$lib/stores/user.store';
import { authenticate } from '$lib/utils/auth';
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 ({ url }) => {
await authenticate(url);
if (!get(user).shouldChangePassword) {
redirect(302, AppRoute.PHOTOS);
}
const $t = await getFormatter();
return {
meta: {
title: $t('change_password'),
},
};
}) satisfies PageLoad;