Refactored user menu and titles

This commit is contained in:
Alexis
2024-08-25 18:24:59 +02:00
parent 8b1eb9c258
commit 3f201b90e3
5 changed files with 105 additions and 40 deletions

View File

@@ -2,15 +2,16 @@
import type { RealtimeChannel } from "@supabase/supabase-js"
import type { World } from "~/models/World";
useHead({
title: "Mondes"
})
const supabase = useSupabaseClient()
const { data: res } = await useFetch("/api/worlds/query")
const worlds = ref<World[]>(res.value?.data as World[])
useHead({
title: "Profil"
})
definePageMeta({
middleware: ["auth-guard"]
})
@@ -18,7 +19,7 @@ definePageMeta({
const user = useSupabaseUser()
// Redirect user back home when they log out on the page
watch(user, (n, _o) => {
watch(user, (n) => {
if (!n) {
navigateTo("/")
}