Files
arthome/app/composables/authorization.ts
2024-08-22 18:20:29 +02:00

11 lines
265 B
TypeScript

export async function isAuthorized() {
const { user } = useUserSession()
const { data: authorized } = await useFetch('/api/authorized', {
method: 'POST',
body: {
email: user.value?.email ?? 'test@nuxt.com',
},
})
return authorized.value
}