Files
immich/web/src/routes/auth/change-password/+page.ts
T
martin c602eaea4a feat(web): automatically update user info (#5647)
* use svelte store

* fix: websocket error when not authenticated

* more routes
2023-12-12 10:35:28 -06:00

19 lines
473 B
TypeScript

import { AppRoute } from '$lib/constants';
import { authenticate } from '$lib/utils/auth';
import { redirect } from '@sveltejs/kit';
import type { PageLoad } from './$types';
import { getSavedUser } from '$lib/stores/user.store';
export const load = (async () => {
await authenticate();
if (!getSavedUser().shouldChangePassword) {
throw redirect(302, AppRoute.PHOTOS);
}
return {
meta: {
title: 'Change Password',
},
};
}) satisfies PageLoad;