protect admin pages after refactoring
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { Readable } from 'stream';
|
||||
import { BUCKET, client } from '$lib/minio';
|
||||
import { fail } from '@sveltejs/kit';
|
||||
import { fail, error } from '@sveltejs/kit';
|
||||
import { v4 as uuidv4 } from 'uuid';
|
||||
|
||||
import { db } from '$lib/server/dbService';
|
||||
@@ -123,3 +123,10 @@ export const actions = {
|
||||
return { etag, error };
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
export const load: PageServerLoad = async (event) => {
|
||||
if (!event.locals.user) {
|
||||
error(404, 'Not found')
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user