feat(web) add user setting page (#1115)
* refactoring * refactor * fix naming * Added animation * add user setting page * Add skeleton for user setting page * styling * styling * Spelling
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
import { redirect } from '@sveltejs/kit';
|
||||
import type { PageServerLoad } from './$types';
|
||||
|
||||
export const load: PageServerLoad = async ({ parent }) => {
|
||||
try {
|
||||
const { user } = await parent();
|
||||
|
||||
if (!user) {
|
||||
throw Error('User is not logged in');
|
||||
}
|
||||
|
||||
return {
|
||||
user: user
|
||||
};
|
||||
} catch (e) {
|
||||
throw redirect(302, '/auth/login');
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user