import type { PageServerLoad } from './$types';
import { getAuthTokens } from '$lib/server/api';
import { redirectToWorkspaceLogin } from '$lib/server/workspace-auth';

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

	if (!accessToken) {
		redirectToWorkspaceLogin(cookies, url);
	}

	return {
		title: 'Reporte de Vencimiento'
	};
};
