Files
scan-wave/src/routes/+layout.server.ts
2025-07-14 15:50:07 +02:00

18 lines
435 B
TypeScript

import type { LayoutServerLoad } from './$types'
export const load: LayoutServerLoad = async ({ locals: { safeGetSession, getUserProfile }, cookies }) => {
const { session, user } = await safeGetSession()
// Get the user profile if the user is authenticated
let profile = null
if (user) {
profile = await getUserProfile(user.id)
}
return {
session,
user,
profile,
cookies: cookies.getAll(),
}
}