mirror of
https://github.com/ArthurDanjou/arthome.git
synced 2026-01-14 12:14:33 +01:00
Add auth
This commit is contained in:
10
app/composables/authorization.ts
Normal file
10
app/composables/authorization.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
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
|
||||
}
|
||||
Reference in New Issue
Block a user