Changed Backend to Supabase
This commit is contained in:
@@ -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")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user