12 lines
381 B
Vue
12 lines
381 B
Vue
<script setup lang="ts">
|
|
// Shows its content only after the shared password has been entered
|
|
defineProps<{ title: string }>()
|
|
|
|
const { data: session, refresh } = await useFetch<{ unlocked: boolean }>('/api/auth/session', { key: 'auth-session' })
|
|
</script>
|
|
|
|
<template>
|
|
<slot v-if="session?.unlocked" />
|
|
<PasswordModal v-else :title="title" @unlocked="refresh()" />
|
|
</template>
|