18 lines
476 B
TypeScript
18 lines
476 B
TypeScript
|
import type { Handle } from '@sveltejs/kit';
|
||
|
|
||
|
import { S3_STORAGE_URL } from '$env/static/private';
|
||
|
|
||
|
import { auth } from '$lib/server/lucia';
|
||
|
import { ObjectStorageS3 } from '$lib/server/storage/s3';
|
||
|
|
||
|
const s3Client = new ObjectStorageS3(S3_STORAGE_URL);
|
||
|
|
||
|
export const handle: Handle = async ({ event, resolve }) => {
|
||
|
event.locals.auth = auth;
|
||
|
event.locals.objectStorage = s3Client;
|
||
|
|
||
|
event.locals.authReq = auth.handleRequest(event);
|
||
|
|
||
|
return await resolve(event);
|
||
|
};
|