Add team creation, team join and debug login screen

This commit is contained in:
2025-08-03 18:58:17 +02:00
parent facb07de5b
commit 36e8ef41bf
15 changed files with 735 additions and 11 deletions
+30 -1
View File
@@ -1,9 +1,38 @@
<script setup lang="ts">
import { useRouter } from '#app';
definePageMeta({
middleware: ['guest']
});
const { fetch } = useUserSession();
const router = useRouter();
const route = useRoute();
// TODO: remove this lol
const { data } = await useFetch('/api/auth/test-list');
async function login(id: number) {
await $fetch(`/api/auth/test?id=${id}`);
await fetch();
await router.push(
(route.query.to
? typeof route.query.to === 'string'
? route.query.to
: route.query.to[0]
: '/') || '/'
);
}
</script>
<template><h1>login</h1></template>
<template>
<h1>login</h1>
<div class="flex flex-col gap-2" v-if="data">
<VaButton v-for="user in data" :key="user.id" @click="login(user.id)"
>Login as "{{ user.name }}" {{ user.email }}</VaButton
>
</div>
</template>
<style scoped></style>