import type { Actions } from '@sveltejs/kit';

import type { PageServerLoad } from './$types';

export const load = (async ({ parent }) => {
	await parent();
}) satisfies PageServerLoad;

export const actions = {
	default: async (event) => {
		return {
			success: true
		};

		// throw redirect(303, `/dashboard/puzzles/${id}`);

		// if (res.ok) {
		// 	const token = res.headers.get('Authorization')?.split(' ')[1];

		// 	if (!token) throw new Error('No token found');

		// 	event.cookies.set('session', token, {
		// 		path: '/'
		// 	});

		// 	throw redirect(303, '/dashboard');
		// }

		// throw redirect(303, '/sign-in');
	}
} satisfies Actions;
