import type { PageServerLoad } from './$types';
import { redirect } from '@sveltejs/kit';
import { getAuthTokens } from '$lib/server/api';

export const load: PageServerLoad = async ({ cookies }) => {
	const { accessToken } = getAuthTokens(cookies);

	if (!accessToken) {
		throw redirect(302, '/login');
	}

	return {
		title: 'Reportes de Facturas'
	};
};
