feat: Add profile page server load function and Svelte component

This commit is contained in:
Sean Morley
2024-07-10 11:34:19 -04:00
parent ad90f03a45
commit dc49416bf6
3 changed files with 49 additions and 2 deletions

View File

@@ -0,0 +1,11 @@
import { redirect } from '@sveltejs/kit';
import type { PageServerLoad, RequestEvent } from '../$types';
export const load: PageServerLoad = async (event: RequestEvent) => {
if (!event.locals.user) {
return redirect(302, '/login');
}
return {
user: event.locals.user
};
};