import { error, json } from '@sveltejs/kit'; import { filterSession, type Session } from '../../../../hooks.server.js'; export const GET = async ({ locals }) => { const data = (await locals.auth()) as Session; if (data === undefined) throw error(403, 'Unauthorized'); if (data === null) throw error(401, 'Session Expired'); return json(filterSession(data)); };