first commit

This commit is contained in:
René Preuß
2023-02-18 14:27:55 +01:00
commit 47b0bf4ec9
23 changed files with 10379 additions and 0 deletions

View File

@@ -0,0 +1,11 @@
<template>
<div>
Guest only page
</div>
</template>
<script setup lang="ts">
definePageMeta({
middleware: ["guest"]
})
</script>

20
playground/pages/home.vue Normal file
View File

@@ -0,0 +1,20 @@
<script setup lang="ts">
import {useAuth} from "#imports";
const {user, signOut} = await useAuth();
definePageMeta({
middleware: ["auth"]
})
</script>
<template>
<div v-if="user">
Hello {{ user.name }}
<button @click="signOut">
Sign Out
</button>
</div>
</template>

View File

@@ -0,0 +1,11 @@
<template>
<div>
Index page
<nuxt-link to="/login">
Login
</nuxt-link>
<nuxt-link to="/guest">
Guest
</nuxt-link>
</div>
</template>

View File

@@ -0,0 +1,18 @@
<script setup lang="ts">
import {definePageMeta, useAuth} from "#imports";
const {signIn} = await useAuth();
definePageMeta({
middleware: ["auth"]
})
</script>
<template>
<div>
<h1>Login</h1>
<button @click="signIn">
Sign In
</button>
</div>
</template>