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,14 @@
|
||||
import { redirect } from '@sveltejs/kit';
|
||||
import type { PageServerLoad } from './$types';
|
||||
|
||||
export const load: PageServerLoad = async ({ parent }) => {
|
||||
const { user } = await parent();
|
||||
|
||||
if (!user) {
|
||||
throw redirect(302, '/auth/login');
|
||||
} else if (!user.isAdmin) {
|
||||
throw redirect(302, '/photos');
|
||||
}
|
||||
|
||||
return { user };
|
||||
};
|
||||
Reference in New Issue
Block a user