feat: Add profile page server load function and Svelte component
This commit is contained in:
11
frontend/src/routes/profile/+page.server.ts
Normal file
11
frontend/src/routes/profile/+page.server.ts
Normal 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
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user