Changed Backend to Supabase

This commit is contained in:
2023-11-26 17:15:55 +01:00
parent 8b76434b41
commit cb3d48d42c
22 changed files with 1420 additions and 346 deletions

View File

@@ -1,12 +1,19 @@
<script setup lang="ts">
const user = useStrapiUser()
<script setup>
const user = useSupabaseUser()
const router = useRouter()
const {logout} = useStrapiAuth()
const supabase = useSupabaseClient()
const tenants = (await supabase.from("tenants").select()).data
const userTenant = ref({})
if(user) userTenant.value = tenants.find(tenant => tenant.id === user.value.app_metadata.tenant)
const userDropdownItems = [
[
{
label: user.value ? user.value.username : "Profil",
label: user.value ? user.value.email : "Profil",
},{
label: userTenant.value.id ? userTenant.value.name : "",
}
],
@@ -14,7 +21,7 @@ const userDropdownItems = [
{
label: "Logout",
click: () => {
logout()
router.push("/login")
}
}