<script lang="ts" setup>
	import errorBound from "~/components/errorBound.vue";
	const { getSession, signIn } = useAuth();

	await getSession({ force: true });

	const { data } = await useAuth();

	let darkBool = ref(data.value?.user?.profile?.nightMode || false);
	// provide("user", ref(dop?.user || null));
	provide("dark", darkBool);
	const p = defineProps<{ error: any }>();
	useHead({
		bodyAttrs: {
			"data-theme": computed(() => {
				return darkBool.value ? "dark" : undefined;
			}).value,
		},
		titleTemplate: "Rockfic | Error!",
	});
</script>

<template>
	<NuxtLayout>
		<error-bound :error="error" />
	</NuxtLayout>
</template>
