16 lines
No EOL
436 B
TypeScript
16 lines
No EOL
436 B
TypeScript
import type { LayoutServerLoad } from './$types';
|
|
import { dev } from '$app/environment';
|
|
|
|
export const load: LayoutServerLoad = async (event) => {
|
|
event.setHeaders({
|
|
'Cache-Control': dev
|
|
? 'no-cache'
|
|
: 'private, max-age=30'
|
|
});
|
|
|
|
// Use the user data already fetched and processed in hooks
|
|
return {
|
|
userSession: event.locals.userSession,
|
|
url: event.url.pathname,
|
|
};
|
|
}; |