M1_ProjetWeb/src/hooks.server.ts

8 lines
252 B
TypeScript
Raw Normal View History

import type { Handle } from '@sveltejs/kit';
export const handle: Handle = async ({ event, resolve }) => {
event.locals.token = await event.cookies.get('token');
2024-12-03 19:20:00 +01:00
event.locals.userId = await event.cookies.get('UID');
return await resolve(event);
};