Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f4089fe111 |
8
ui/src/routes/admin/+layout.server.ts
Normal file
8
ui/src/routes/admin/+layout.server.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
import { redirect } from '@sveltejs/kit';
|
||||
import type { LayoutServerLoad } from './$types';
|
||||
|
||||
export const load: LayoutServerLoad = async ({ locals }) => {
|
||||
if (locals.user?.role !== 'admin') {
|
||||
redirect(302, '/');
|
||||
}
|
||||
};
|
||||
6
ui/src/routes/admin/+page.server.ts
Normal file
6
ui/src/routes/admin/+page.server.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
import { redirect } from '@sveltejs/kit';
|
||||
import type { PageServerLoad } from './$types';
|
||||
|
||||
export const load: PageServerLoad = async () => {
|
||||
redirect(302, '/admin/scrape');
|
||||
};
|
||||
Reference in New Issue
Block a user