initial commit

This commit is contained in:
Michael Dausmann
2023-01-02 16:35:39 +11:00
commit 6632e707ce
13 changed files with 13713 additions and 0 deletions

30
layouts/authenticated.vue Normal file
View File

@@ -0,0 +1,30 @@
<script setup lang="ts">
const supabase = useSupabaseAuthClient();
const user = await useSupabaseUser();
const email = (user.value)?user.value.email:null;
async function signout() {
const { error } = await supabase.auth.signOut()
navigateTo('/');
}
// onMounted(() => {
// watchEffect(() => {
// if(user.value) {
// console.log('user now has a value');
// }
// })
// })
</script>
<template>
<div>
<h3>Authenticated Header</h3>
<div v-if="email">logged in as: {{ email }}: <button @click="signout()">Sign Out</button></div>
<div v-if="!email">Not Logged in</div>
<hr>
<slot />
<hr>
<h4>Authenticated Footer</h4>
</div>
</template>

9
layouts/default.vue Normal file
View File

@@ -0,0 +1,9 @@
<template>
<div>
<h3>Default Header</h3>
<hr>
<slot />
<hr>
<h4>Default Footer</h4>
</div>
</template>